You can specify your VirtualEnv using WSGIDaemonProcess: http://modwsgi.readthedocs.io/en/develop/configuration-directives/WSGIPythonPath.html
Alternatively, you can use gunicorn to run your server behind Apache: https://docs.djangoproject.com/en/2.0/howto/deployment/wsgi/gunicorn/
My recommendation is to not go with Apache since you are just starting, and pick Nginx, It works much better on smaller servers with lower memory. There are a host of options when using Nginx for serving Django including Gunicorn, uWSGI.
On Thu, Jun 28, 2018 at 9:35 PM Gerardo Palazuelos Guerrero <gerardo.palazuelos@gmail.com> wrote:
hi Bruce,I found this link as part of a django training I did in a udemy course (https://www.udemy.com/the-ultimate-beginners-guide-to-django-python-web-dev-website).Link is:I hopes that helps you.Gerardo.----Gerardo Palazuelos GuerreroOn Thu, Jun 28, 2018 at 9:46 AM, Bruce Whealton <futurewavewebdevelopment@gmail.com> wrote:Hello all,--For a long time, this has perplexed me and I cannot find the answer. It is a crucial recommendation for deploying Django (or any Python app for that matter) into production.Here is the issue. I have two web hosting accounts, one is VPS with ssh root access. The other is shared hosting that specifically targets users of Python-based applications such as Django.It appears that the shared Python environment does not allow ssh access.In all cases, a virtualenv is recommended for any Python deployment. In both cases, I have Apache as the web server with mod_wsgi. Obviously, I need the server, Apache, to activate theDjango environment. I can ssh to my VPS but what good is that. I don't need my username to be activating the Python isolated environment. As soon as I close the ssh session the activated environmentis no longer activated. My best guess is that the Apache user must activate the virtual environment and keep it activated as an isolated virtual environment.I have googled and googled for an answer to something so basic to deploying into production an isolated Python environment for Django (or any Python application) for that matter. So, here is my best effortto ask the question clearly. How do I deploy into production a Django application following the best practice of using an isolated virtual environment that is activated even after I close my ssh session?Regarding the shared Python hosting, if I don't have ssh access I cannot even issue Pypi commands to install modules that I might need for my Django app.Thanks,Bruce
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/78f2b728-ae20-4daf-9d38-221f7487af05%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAJ8iCyMjjWFMRPdzYc3uWDkTo_AD8oa_nTFVSntt1VbZNaXHSw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAF39Kz_AUDVpL9E9wkPhqxb5_mJnc%3D3SWQYw9nSaBJmm3815gg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment