I installed the registration module, added it to settings.py. When I tried to run syncdb (% python sitename/manage.py syncdb --settings sitename.devsettings)
It gav
Since this page ranks nicely in Google, it seems like a good place for a general answer that might help. Sometimes the folder name in svn/git is different than the folder name in settings.py -- a trap for the unwary.
So, if INSTALLED_APPS
references your stuff as mywhatever.someapp then it is likely you want settings.py to be in the "mywhatever" folder, with a subfolder "someapp" that contains an __init__.py
file.
If this happens to you on Windows and while using virtualenv, it's possibly because of virtualenv.
Install that package on the local (non virtualenv) environment and it should work.
I had the same problem with django-crispy-forms.
I ran into this problem because I was messing up with my virtualenv.
I had two windows open:
I had successfully installed the Django-registration package into my venv on my Windows computer:
$ . venv/Scripts/activate
$ pip install Django-registration-redux==2.0
But my server was not in the venv, so it could not find the package.
Stopped the server, entered venv in that window, then restarted the server and all is good.
You mention sys.path so you might have tried this, however this was my problem and I'm sure some people reading this have it too.
open the command prompt and enter (with the trailing slash):
export PYTHONPATH=pathto/myproject/
then enter:
export DJANGO_SETTINGS_MODULE=settings
This allows me to edit the settings.py file to list the INSTALLED_APPS like this:
INSTALLED_APPS = (
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'myapp',
'registration',
)
instead of:
INSTALLED_APPS = (
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'myproject.myapp',
'myproject.registration',
)
I've faced this problem until a figured out that the enviroment was not activated.
Check if your Virtualenv is activated. If not, run in the shell
source .<enviroment name>/bin/activate
My first guess would be you haven't added 'registration'
into installed apps
in the settings.py
file.
Perhaps you are using a different settings.py
(Or localsettings.py
) on the server.