5

I'm pretty new to Django and I'm having some difficulty getting my settings.py to load properly. I'm getting the following error:

ImproperlyConfigured at /admin

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

However, my settings.py INSTALLED_APPS looks as follows:

INSTALLED_APPS = (
 'django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.sites',
 'django.contrib.messages',
 'django.contrib.staticfiles',
 'django.contrib.admin',
 'squaredcrm' )

Looking through the error log, I've noticed its not picking up any of my changes to installed apps:

Django Version: 1.4.3 Python Version: 2.7.3 Installed Applications: ('django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.messages', 'django.contrib.staticfiles') Installed Middleware: ('django.middleware.common.CommonMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware')

I cannot figure this out for the life of me. Any other changes seem to be working, but this field will not update. Any ideas?

René Höhle
27.4k22 gold badges78 silver badges91 bronze badges
asked Dec 20, 2012 at 1:52

2 Answers 2

4

I know it's a silly question, but did you restart your server after making the changes?

By default, production (by which I mean Apache-based, and perhaps other) instances of Django do not auto-reload on changes. The Django development server will auto-reload, as long as you don't specifically tell it not to.

You have to restart (or stop and then start) an Apache-based Django for it to see the file changes.

Important tip: do not run a production site off of the development server. It is slow, slow, slow, and probably insecure in ways I don't know about.

answered Dec 20, 2012 at 3:01
Sign up to request clarification or add additional context in comments.

2 Comments

You sir, are a genius. I did not even think to restart Apache. This has solved my problem. Thank you all for your help, and happy holidays.
I'm not sure that having done several face-plants on this particular problem qualifies as "genius" -- maybe more like "slow learner." :-)
2

If other changes are picked up, this is probably because INSTALLED_APPS is being redefined somewhere in your settings.py file.

This could be:

  • At a subsequent line.
  • In an import (likely a from x import *).
answered Dec 20, 2012 at 2:02

5 Comments

Hello and thank you for the quick reply. I appreciate the help. Sadly, there are no imports in the settings.py file as is there nowhere else that installed_apps is being redefined in that file.
Edit: I stand corrected, this is still an issue. I apologize.
To configure Admin in your application look at this
Hi, that is the guide I followed to configure the admin setup. I'm stuck because it is not loading.
This was it for me! Rewriting my ALLOWED_HOSTS at the beginning of the file, without realizing it was already defined half a page down. Thanks four years later :-)

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.