Getting stuck at Django error: No module named registration

后端 未结 15 2201
一向
一向 2020-12-30 01:35

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

相关标签:
15条回答
  • 2020-12-30 01:36

    just do this in your virtualenv

    pip install django-registration

    0 讨论(0)
  • 2020-12-30 01:36

    I had this problem. I had saved the app in the project folder (as in, the same folder as manage.py), but referenced to "projectname.appname" instead of just "appname" in INSTALLED_APPS in settings.py.

    0 讨论(0)
  • 2020-12-30 01:36

    When I've installed django-registration to my virtual env, I've had the same error. Don't know how it worked exactly, but when I've installed this lib to the main Python directory (not virtual env) the error has disappeared.

    Maybe It will help to someone.

    0 讨论(0)
  • 2020-12-30 01:38

    I had this on SX with virtualenv too, after installing with PIP as per the docs. I did another install using easy_install and after that, it all worked.

    easy_install -Z django-registration
    
    0 讨论(0)
  • 2020-12-30 01:39

    Fixed! I had the same problem, I was trying to register submodules, like:

    project
     organization
        categories
    

    In my settings file I added

    > INSTALLED_APPS = (
    >     'django.contrib.admin',
    >     'django.contrib.auth',
    >     'django.contrib.contenttypes',
    >     'django.contrib.sessions',
    >     'django.contrib.sites',
    >     ...
    >     'organization.categories',  )
    

    When you generate a module in the folder categories you have a init.pyc I copied this file into "organization" folder, then I execute the following commands:

    sudo python manage.py makemigrations
    sudo ./manage.py syncdb
    

    And it works file!

    0 讨论(0)
  • 2020-12-30 01:40

    Make sure you have an entry in installed_apps, And you have the minimum 4 files in your apps. init.py, urls.py, models.py, and views.py

    0 讨论(0)
提交回复
热议问题