<div dir="ltr"><div>I've been doing some reading and tests on this. I've gotten things to work locally inside a virtual environment, including the all-important database communication, so we're looking good there. The docs say, though, that environments can't be moved between platforms; making this extra fun is that I'm developing on Windows and wanting to serve files from Debian. I suppose my next step is to get an environment set up on the Debian server and make sure it works from there. Once it does, Nginx and UWSGI will be brought into the mix.<br><br></div>As I understand it, I'd want to copy my entire project directory from my Windows machine over to the server, probably in /var/www/mySite. I'd then cd into /var/www, run virtualenv mySite, activate the new environment, install my packages, and I should be set? Again, this isn't touching serving for now, just getting my project to run. Fortunately, it doesn't use hard-coded paths, output files, or anything else. I use {{url_for()}} for all my links and script/style includes, and I never rely on Windows-only libraries. This should be reasonably easy, assuming I have the general process correct.<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, May 4, 2016 at 10:07 AM, Corey Boyle <span dir="ltr"><<a href="mailto:coreybrett@gmail.com" target="_blank">coreybrett@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Virtualenv works by temporarily changing the active PATH so that your<br>
scripts see an alternate (and isolated) Python interpreter and<br>
libraries instead of seeing the globally installed ones.<br>
<br>
So... I don't think it would ever be to late to start using a virtualenv.<br>
Perhaps the only thing that could be effected is the paths of your<br>
import statements.<br>
<br>
Basically, you need to setup a virtualenv on the server, that matches<br>
the virtualenv on your dev box, and tell Apache to use it when<br>
executing your Python scripts. (I've never used Apache with Python, so<br>
I can't help with that part.)<br>
<br>
I also like using virtualenvwrapper, but I'm not sure if that would<br>
help or hurt you at this point.<br>
<br>
On debian...<br>
apt install python-virtualenv<br>
apt install virtualenvwrapper<br>
<br>
What OS are you using for development?<br>
<div><div class="h5"><br>
On Wed, May 4, 2016 at 9:06 AM, Alex Hall <<a href="mailto:ahall@autodist.com">ahall@autodist.com</a>> wrote:<br>
> Hey list,<br>
> At the urging of several members here, I'll give virtualenv a shot while I'm<br>
> installing and moving everything. Currently, I have my Flask app working.<br>
> It's small--just a couple pages with a bunch of JS--but does need Pyodbc and<br>
> WTF to work. Is there a way I can take my existing app, put it into a<br>
> virtual environment, and toss the whole thing on my Debian server? I've<br>
> installed virtualenv on the server already, as well as UWSGI. Is this<br>
> doable, or should I upload the entire directory and somehow put it into a<br>
> virtual environment on the server? Am I too late--that is, can this only be<br>
> done when you start a new project?<br>
><br>
> --<br>
> Alex Hall<br>
> Automatic Distributors, IT department<br>
> <a href="mailto:ahall@autodist.com">ahall@autodist.com</a><br>
><br>
</div></div>> _______________________________________________<br>
> Flask mailing list<br>
> <a href="mailto:Flask@python.org">Flask@python.org</a><br>
> <a href="https://mail.python.org/mailman/listinfo/flask" rel="noreferrer" target="_blank">https://mail.python.org/mailman/listinfo/flask</a><br>
><br>
</blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature"><div dir="ltr"><div><div>Alex Hall<br></div>Automatic Distributors, IT department<br></div><a href="mailto:ahall@autodist.com" target="_blank">ahall@autodist.com</a><br></div></div>
</div>