JSchins
JSchins

Reputation: 117

Remove Django app name from path with custom domain Heroku

I have a Django app running on Heroku and just got a custom domain set up for it. I would like to be able to remove the app name from the path (www.customdomain.com/app-name). I have tried working with the project's urls.py to give it an empty string regex and map that to my App's urls.py but that will only work with the index page. Any suggestions would be appreciated, thanks!

Github: https://github.com/Schins02/stats

Site: http://www.texasrangersstats.com/rangerstats/

(Would like to remove app name rangerstats from path)

EDIT: Whoops, this was a lot easier than I thought, just import the views from the app into the project's urls.py and map the routes there.

Upvotes: 1

Views: 639

Answers (1)

Daniel Roseman
Daniel Roseman

Reputation: 599630

As I said in the comment, if you don't want a prefix, don't use one.

Either include your app URLs with no prefix:

url('', include('rangerstats.urls')),

or copy your app's URLs directly into the main urls.py.

Upvotes: 1

Related Questions