0

I have this kind of tree for my django project

project tree

project/
  apache/
    apache_django_wsgi.conf
    project.wsgi
    ...
  module1/
  module2/
  settings.py
  settings_production.py
  ...

project.wsgi

import os, sys

apache_configuration = os.path.dirname(__file__)
project = os.path.dirname(apache_configuration)
workspace = os.path.dirname(project)
sys.path.append(workspace) 

os.environ['DJANGO_SETTINGS_MODULE'] = 'project.settings_production'
import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()

I'm getting this kind of error (debugged on from the template):

No module named module1

What am I doing wrong ?

1 Answer 1

1

Also add:

sys.path.append(project)
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.