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 gave me "Error: No module named registration"
The same setup works (using the same files for everything) fine on the server. This happens on my local machine running OS X.
I checked the sys.path, the path where registration module resides is listed, and the actual module is in place as well. Since there is not much else being outputted, I am not sure how to debug further. What could be causing this problem?
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.
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', )
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With