How to deploy Django 1.6, Python 3.3 and Apache?

Firstly, the OS I work on is Fedora 20.

It seems that every way that is mentioned with Django and Apache is either outdated or there is no documentation at all.

I tried mod_wsgi and I installed all this, but there is conflicting documentation. One says you should have django.wsgi (the old Django has this), and in later documentation you should have wsgi.py. I tried both methods and all kinds of things in the httpd.conf file, nothing works and it all comes back with Forbidden. Also, when trying a Hello World script, it always returns an internal server error.

Then I tried uwsgi. I can use this to get the uwsgi server, and it seems to basically work similarly to the simple use of python3 manage.py runningerver, so I installed the mod_proxy_uwsgi module for Apache and there is absolutely no documentation on how to use it, so I just did something- something like ProxyPass / wsgi // localhost: 8000 / in httpd.conf. All of this also returns an internal server error.

The main answer I want is: How exactly do I deploy a Django 1.6 project that uses Python 3 on Apache?

+6
source share
2 answers

This did not work for you? It is listed under Django 1.6 ... again, Python 3.x still looks like for many things. https://docs.djangoproject.com/en/1.6/howto/deployment/wsgi/modwsgi/

+1
source

It was allowed. As it turned out, SELinux blocked httpd access to my Django project. I just used the following command and restarted the computer:

setsebool -P httpd_read_user_content 1 setsebool -P httpd_enable_homedirs 1 

This will allow MOD_WSGI to work correctly for deployment.

+1
source

All Articles