Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What happens to the Django admin site during production?

Django offers an admin interface at /admin. Is it not safe to keep this URL during production?

Or should I change the URL to /d0oai32492384h24ui234nij23n4k2jnkjnkjn or something?

like image 768
Zorgan Avatar asked Nov 07 '22 09:11

Zorgan


1 Answers

I guess this is what you want (this won't work on Django < 2.0):

urlpatterns = [
    path('d0oai32492384h24ui234nij23n4k2jnkjnkjn/', admin.site.urls),
]

This will work on Django < 2.0:

urlpatterns = [
    url(r'^d0oai32492384h24ui234nij23n4k2jnkjnkjn/', admin.site.urls),
]

This has to be done in your main urls.py file. You can access it by typing:

http://localhost:8000/d0oai32492384h24ui234nij23n4k2jnkjnkjn/
like image 129
Madi7 Avatar answered Nov 14 '22 22:11

Madi7