changing admin site url
-
13-09-2019 - |
Question
Is there a way to change the url to open the admin site in django? I don't want to use the default /admin url. I am new to django so please try giving a bit more detailed information.
Solution
In urls.py, change the line that reads:
(r'^admin/(.*)', admin.site.root),
to something like:
(r'^new_admin/(.*)', admin.site.root),
so now instead of http://example.com/admin you'd use http://example.com/new_admin
OTHER TIPS
Sure, the file urls.py in the root of your project maps URLs to handlers. Just change the line
(r'^admin/', include(admin.site.urls)),
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow