Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I do it with symlinks and completely separate release directories. Ie, a deployment involves cloning the entire project into a new directory, building the virtualenv inside that, then switching the "production" symlink to point at that directory.</p> <p>My layout is basically </p> <pre><code>/var/www/myapp/ uploads/ tmp/ releases/ 001/myapp/ 002/myapp/ 003/myapp/ ve/ ...etc in each release directory... myapp # symlink to releases/003/myapp/ </code></pre> <p>So, when I deploy to production, my deployment scripts rsync a completely fresh copy to <code>/var/www/myapp/releases/004/myapp/</code>, build a virtualenv in there, install all the packages into it, then </p> <pre><code>rm -f /var/www/myapp/myapp ln -s /var/www/myapp/releases/004/myapp/ /var/www/myapp/myapp </code></pre> <p>My actual deployment script is a little more complicated as I also make sure to keep the previous release around and marked so if I notice that something is really broken, rolling back is just a matter of switching the symlink to point back at the previous one. (some extra work is also necessary to clean up old, unused releases if you are worried about the disk space).</p> <p>Every external reference (in apache config files or wsgi files or whatever) point at libraries and binaries in the virtualenv as <code>/var/www/myapp/myapp/ve/</code>. I also shun the use of <code>source ve/bin/activate</code> and instead point at the full path in config files and I edit <code>manage.py</code> to use <code>#!ve/bin/python</code> so I can run commands with <code>./manage.py whatever</code> and it will always work without me having to remember if I've activated the right virtualenv.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload