[Answer]-Django deployment with mod_wsgi on WAMP

1👍

This has nothing to do with middleware, that’s just where the error was encountered. The error itself is the last line: “Could not import settings ‘myapp.settings'”. This is almost certainly because you haven’t modified the PYTHONPATH – either in your wsgi or your Apache conf – to put “myapp” on the path.

See for instance the example Apache conf in the Django docs – there’s a WSGIPythonPath directive there to add the app to the Python path, which you don’t have.

0👍

Placing a WSGIPythonPath directive in the httpd.conf prevented the server from starting, but the problem was indeed related to the path not being declared.

Adding:

sys.path.append("c:/wamp/www/myapp")

to the wsgi.py file did the trick.

Thanks to Daniel Roseman for putting me on the right track.

👤inegm

Leave a comment