I second Melvyn.

On top of what he wrote, Bruce, I work in an environment with exactly
this limitation: a shared hosting running Apache where I don't have
access
 to ssh.

I build my environment (install libs, for that matter) locally and
transfer all my pack through ftp in one shot.

As Melvyn told us, "activate" a virtualenv means "put the path to your
libs first, in the PATH variable". But it can also be done inside a
Python program, too, manipulating `sys.path`.

You can see an example here:
http://blog.aprendapython.com.br/articles/setup-de-python-django-pyramid-dreamhost-1fr70/

In spite the blog post is in Brazilian Portuguese, Google Translator
is your friend and examples are in Python, afterall. ;-)

Cheers.



On 1 July 2018 at 09:38, Melvyn Sopacua <m.r.sopa...@gmail.com> wrote:
> On donderdag 28 juni 2018 17:46:42 CEST Bruce Whealton wrote:
>
>>             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 the
>> Django 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 environment
>> is 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.
>
> Virtualenv "activation" is not magic. It simply adjusts PATH so that the
> virtualenv's bin directory is first. This means that whenever "python" or 
> "pip"
> is typed into the shell it will not execute `/usr/bin/python` but
> `your-virtualenv/bin/python`. Handing apache a sanitized PATH with the
> virtualenv bin dir as first directory, will effectively do the same as
> "activation".
>
> (To be complete: activate also alters your shell prompt, this has no effect in
> one-off application launches).
>
> --
> Melvyn Sopacua
>
> --
> 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+unsubscr...@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/2410185.edddNGrWiM%40fritzbook.
> 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+unsubscr...@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/CAFmXjSAFWT2g8zmh2moxbnDog%2BjYf2gzsCXBd%3D7MCGbZ1S7JJg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to