python - Apache and Django -
im trying configure django site served apache.
folder layout
`-- django | `-- webtools |-- 1 |-- __init__.py |-- __init__.pyc |-- apache | `-- django.wsgi |-- macmonster | |-- __init__.py | |-- __init__.pyc | |-- models.py | |-- models.pyc | |-- tests.py | |-- views.py | `-- views.pyc |-- manage.py |-- modules | |-- __init__.py | |-- __init__.pyc | |-- macaddr.py | |-- macaddr.pyc | |-- validate.py | `-- validate.pyc |-- settings.py |-- settings.pyc |-- urls.py `-- urls.pyc
/etc/httpd/conf.d/django.conf
<virtualhost *:80 > servername direct.macmonster.co.uk wsgiscriptalias / /opt/django/webtools/apache/django.wsgi </virtualhost>
/opt/django/webtools/apache/django.wsgi
import os, sys sys.path.append('/opt/django/webtools') os.environ.setdefault("django_settings_module", "settings") import django.core.handlers.wsgi application = django.core.handlers.wsgi.wsgihandler()
the main error im getting within logs :
templatesyntaxerror: caught importerror while rendering: no module named webtools.macmonster
thanks,
if webtools top-level package, should add together /opt/django
sys.path
, not /opt/django/webtools
.
python django
No comments:
Post a Comment