Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Run django application without django.contrib.admin

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?

like image 742
python Avatar asked Oct 29 '15 17:10

python


People also ask

What happens if Django admin is not recognized?

'django-admin' is not recognized as an internal or external command, operable program or batch file. To fix this, first close the terminal window and relaunch it with administrator privileges. Once you launch the elevated terminal window change directory to where you wish to start your Django project.

How do I restrict access to parts of Django admin?

Django admin allows access to users marked as is_staff=True . To disable a user from being able to access the admin, you should set is_staff=False . This holds true even if the user is a superuser. is_superuser=True .

Is it possible to automatically generate an admin page in Django?

Generating admin sites for your staff or clients to add, change and delete content is tedious work that doesn't require much creativity. For that reason, Django entirely automates creation of admin interfaces for models.

What is Django contrib admin?

One of the most powerful parts of Django is the automatic admin interface. It reads metadata from your models to provide a quick, model-centric interface where trusted users can manage content on your site. The admin's recommended use is limited to an organization's internal management tool.


2 Answers

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.

like image 58
narendra-choudhary Avatar answered Sep 20 '22 17:09

narendra-choudhary


I have resolved this issue.

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

like image 44
python Avatar answered Sep 18 '22 17:09

python