Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Showing how to use Flask in a virtualenv in CGI #558

Closed
wants to merge 2 commits into from

4 participants

@dgilman

What's the right way to write virtualenv? Is it camel cased? Do you capitalize it in the title?

@travisbot

This pull request passes (merged 3e184c5c into ea2a062).

@kennethreitz
Collaborator

Virtualenv is supposed to be lowercased, according to the team behind it. It's improper in my opinion, but consistency is more important than grammar :)

dgilman added some commits
@dgilman dgilman Showing how to use Flask in a virtualenv in CGI ee2b16d
@dgilman dgilman Uncapitalize virtualenv in CGI documentation
Also recommend use of the site module instead of modifying sys.path
directly.
1ff7283
@mitsuhiko
Owner

If someone wants to use CGI they only have to point the shebang there. Why anyone would want to use CGI however I don't know so I am not going to put it into the docs.

@mitsuhiko mitsuhiko closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Sep 11, 2012
  1. @dgilman
  2. @dgilman

    Uncapitalize virtualenv in CGI documentation

    dgilman authored
    Also recommend use of the site module instead of modifying sys.path
    directly.
This page is out of date. Refresh to see the latest.
Showing with 15 additions and 0 deletions.
  1. +15 −0 docs/deploying/cgi.rst
View
15 docs/deploying/cgi.rst
@@ -28,6 +28,21 @@ First you need to create the CGI application file. Let's call it
CGIHandler().run(app)
+Using CGI and virtualenv
+------------------------
+
+If your app uses virtualenv to manage its enviroment you'll need to make
+a few changes to the above script to load the virtualenv enviroment::
+
+ #!/my/virtualenv/folder/bin/python
+ import site
+ site.addsitedir("/my/virtualenv/folder/lib/pythonX.Y/site-packages")
+
+ from wsgiref.handlers import CGIHandler
+ from yourapplication import app
+
+ CGIHandler().run(app)
+
Server Setup
------------
Something went wrong with that request. Please try again.