yuvi
yuvi

Reputation: 18427

deploying multiple django projects with apache, one wsgi or many?

I have some django projects that I worked on and I want to deploy them with wamp server. I want that my structure would look like this:

/www
    /project1
             /static
             /media
             /templates
             /project1
                  /settings.py
                  /urls.py
             /app1
             /app2

    /project2
             /static
             /media
             /templates
             /project1
                  /settings.py
                  /urls.py
             /app1
             /app2

Then the urls would point to:

http://localhost/project1/(urls of project1)
http://localhost/project2/(urls of project2)

Each project uses a different database, a different admin site (some customized), and so on. I will never need to share data between them. I tried searching and reading about it, and using multiple WSGI scripts seems really buggy. Also as I understand it, I can't use the recommended daemon mode because I'm using windows.

Is it frowned upon to use multiple wsgi scripts on the same server? Should I try to create one that will handle all the projects? How would it look like, and how would the apache be configured to work with it? Is my intended structure above completely wrong?

I am using Apache 2.2e with mod_wsgi 3.3, Django 1.5.1 and python 2.7

Upvotes: 0

Views: 739

Answers (1)

Graham Dumpleton
Graham Dumpleton

Reputation: 58543

No it is not frowned on to use multiple WSGI scripts and doing so is not buggy as such, except to the extent that Django generates a dodgy WSGI script file which you need to change to ensure you don't get environment variable leakage.

That said, you may still have issues with third party C extension modules for Python which are broken and don't work in sub interpreters, which is why it is preferred to use daemon mode if you can, as you can workaround such buggy third party modules.

So overall there is no issue with mod_wsgi, but you may encounter issues if using other software which uses a sub optimal way of configuring things, or which are broken by design.

Personally I would suggest simply not using Windows as it is a poor environment to be running Python web applications. Only use Windows if you have absolute no choice.

Upvotes: 1

Related Questions