4👍
I just had this problem. It went away when I added sys.path.append('/path/to/project')
to my .wsgi file.
2👍
Is the application containing your Django project in your $PYTHONPATH
(when Python is invoked in a server context)? For example, if your Django project is at /home/wwwuser/web/myproj
, then /home/wwwuser/web
should be in your $PYTHONPATH
. You should set this in the script that loads the project when invoked from the web server.
- [Django]-Jenkins not failing on tests that fail in coverage
- [Django]-Django 1.1 – comments – 'render_comment_form' returns TemplateSyntaxError
- [Django]-Django Rest Framework regroup queryset by a category
1👍
Just a guess, but unless you’ve explicitly made sure that your app is on PYTHONPATH, you should be specifying views in urls.py as myproject.myapp.views.functionname.
Otherwise:
- check if you’re setting PYTHONPATH, or what to. Your project directory should be in there.
- if you enable the django admin (by uncommenting the lines that are there by default in urls.py), does that work?
- [Django]-Fresh mysql database getting "mydb.background_task doesn't exist" – Django
- [Django]-Redirect to "next" after python-social-auth login
- [Django]-Getting a ValueError: invalid literal for int() with base 10: '' error and don't know why
1👍
- All required env variables should be set in django.wsgi. You could compare the env declared in django.wsgi and the env of executing
./manage runserver
and make sure they are same. - Furthermore, if there is another myapp package which could be found through PYTHONPATH before
/usr/local/django/myapp
,ImportError
may be raised.
👤okm
- [Django]-Django Postgresql syncdb error
- [Django]-Uwsgi: RuntimeError: cannot release un-acquired lock
Source:stackexchange.com