Note that there are some explanatory texts on larger screens.

plurals
  1. PODjango error - no module named
    text
    copied!<p>Here is my relevant directory structure (Windows 7, Python 2.7, virtualenv)</p> <pre><code>-userProf - - manage.py - -UserProfile - sampleapp_db - urls.py - views.py - wsgi.py - __init__.py - -libs - - __init__.py - -allauth - - app_settings.py - - models.py - - tests.py - - urls.py - - utils.py - - __init__.py - - - -account - - - admin.py - - - context_processors.py - - - models.py - - - urls.py - - - __init__.py - -socialaccount - - - admin.py - - - context_processors.py - - - models.py - - - urls.py - - - views.py - - - __init__.py - - - - -templates - -account - - - base.html - - - email.html -settings - base_settings.py - dev.py - __init__.py - -static -css </code></pre> <p>I get the following error when I try to run this django app <strong>Error: No module named account</strong></p> <p>I have read other posts on SO that refer to the syspath being the issue or that the appname matches the project name</p> <p><a href="https://stackoverflow.com/questions/7367577/django-shell-no-module-named-settings">Django Shell No module named settings</a> </p> <p>...as a result of this, I added the following statements in the base_settings.py file</p> <pre><code>import sys base = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) base_parent = os.path.dirname(base) sys.path.append(base) sys.path.append(base_parent) sys.path.append(os.path.join(base,'libs')) sys.path.append(os.path.join(base,'libs','allauth','account')) </code></pre> <p>I verified that the sys.path is correct by putting a break in PyCharm and evaluating sys.path</p> <p><em>Should I be putting this in manage.py?</em></p> <p>Some other SO postings referred to not being able to import the module but I can launch the python console and import UserProfile.libs.allauth.account without any exceptions being thrown! </p> <p>My base_setings.py has the following relevant section</p> <pre><code>INSTALLED_APPS = ( 'UserProfile.libs.allauth.account', ) </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload