Added installation docs
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by Armin Ronacher · committed by Armin Ronacher · parent 625eba4 · Browse files · 1 file·+98 added−1 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
1 file+98 added−1 removed
- other:+98 added−1 removed
Provenance
- Commit
4edec48- Tree
7b341c4- Author
Armin Ronacher <armin.ronacher@active-4.com>- Committer
Armin Ronacher <armin.ronacher@active-4.com>- Parent
625eba4
1 file changed+98 added−1 removed
modified:docs/installation.rst+98 added-1 removed
1 unmodified line2 3 Installation4 ============5 6-Blafasel, add me6+Flask is a microframework and yet it depends on external libraries. There7+are various ways how you can install that library and this explains each8+way and why there are multiple ways.9+10+Flask depends on two external libraries: `Werkzeug11+<http://werkzeug.pocoo.org/>`_ and `Jinja2 <http://jinja.pocoo.org/2/>`_.12+The first on is responsible for interfacing WSGI the latter to render13+templates. Now you are maybe asking, what is WSGI? WSGI is a standard14+in Python that is basically responsible for ensuring that your application15+is behaving in a specific way that you can run it on different16+environments (for example on a local development server, on an Apache2, on17+lighttpd, on Google's appengine or whatever you have in mind).18+19+So how do you get all that on your computer in no time? The most kick-ass20+method is virtualenv, so let's look at that first.21+22+virtualenv23+----------24+25+Virtualenv is what you want to use during development and in production if26+you have shell access. So first: what does virtualenv do? If you are27+like me and you like Python, chances are you want to use it for another28+project as well. Now the more projects you have, the more likely it is29+that you will be working with different versions of Python itself or a30+library involved. Because let's face it: quite often libraries break31+backwards compatibility and it's unlikely that your application will32+not have any dependencies, that just won't happen. So virtualenv for the33+rescue!34+35+It basically makes it possible to have multiple side-by-side36+"installations" of Python, each for your own project. It's not actually37+an installation but a clever way to keep things separated.38+39+So let's see how that works!40+41+If you are on OS X or Linux chances are that one of the following two42+commands will for for you::43+44+ sudo easy_install virtualenv45+46+or even better::47+48+ sudo pip install virtualenv49+50+Changes are you have virtualenv installed on your system then. Maybe it's51+even in your package manager (on ubuntu try ``sudo apt-get install52+python-virtualenv``).53+54+On windows, just installed virtualenv from the `Python Package Index55+<http://pypi.python.org/pypi/virtualenv>`_.56+57+So now that you have virtualenv running just fire up a shell and create58+your own environment. I usually create a folder and a `env` folder59+within::60+61+ $ mkdir myproject62+ $ cd myproject63+ $ virtualenv env64+ New python executable in env/bin/python65+ Installing setuptools............done.66+67+Now you only have to activate it, whenever you work with it. On OS X and68+Linux do the following::69+70+ $ source env/bin/activate71+72+If you are a Windows user, the following command is for you::73+74+ $ env\scripts\activate75+76+Either way, you should now be using your virtualenv (see how the prompt of77+your shell has changed to show the virtualenv).78+79+Now you can just enter the following command to get Flask activated in80+your virtualenv::81+82+ $ easy_install Flask83+84+A few seconds later you are good to go.85+86+87+System Wide Installation88+------------------------89+90+This is possible as well, but I would not recommend it. Just run91+`easy_install` with root rights::92+93+ sudo easy_install Flask94+95+(Run it in an Admin shell on Windows systems and without the `sudo`). 96+97+98+The Drop into Place Version99+---------------------------100+101+Now I really don't recommend this way on using Flask, but you can do that102+of course as well. Download the `dip` zipfile from the website and unzip103+it next to your application.