Run django application without django.contrib.admin

拟墨画扇 提交于 2020-12-05 04:54:32

问题


I am trying to run my Django Application without Django admin panel because I don't need it right now but getting an exception value:

Put 'django.contrib.admin' in your INSTALLED_APPS setting in order to use the admin application.

Could I ran my application without django.contrib.admin ? Even if go my localhost:8000 it is showing you need to add django.contrib.admin in your installed_apps?


回答1:


django.contrib.admin is simply a Django app.

Remove or comment django.contrib.admin from INSTALLED_APPS in settings.py file.

Also remove or comment from django.contrib import admin from admin.py',urls.py and all the files having this import statement.

Remove url(r'^admin/', include(admin.site.urls) from urlpatterns in urls.py.




回答2:


I have resolved this issue.

I had #url(r'^admin/', include(admin.site.urls)), in my urls.py which I just commented out.



来源:https://stackoverflow.com/questions/33420918/run-django-application-without-django-contrib-admin

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!