tweaks to style
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by Ori Livneh · committed by Ron DuPlain · parent e5161a7 · Browse files · 1 file·+54 added−56 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+54 added−56 removed
- other:+54 added−56 removed
Provenance
- Commit
1a9e082- Tree
467cb3c- Author
Ori Livneh <ori.livneh@gmail.com>- Committer
Ron DuPlain <ron.duplain@gmail.com>- Parent
e5161a7
1 file changed+54 added−56 removed
modified:docs/installation.rst+54 added-56 removed
7 unmodified lines8 Werkzeug is a toolkit for WSGI, the standard Python interface between web9 applications and a variety of servers for both development and deployment.10 Jinja2 renders templates.11 12-So how do you get all that on your computer quickly? There are many ways,13-as this section will explain, but the most kick-ass method is14-virtualenv, so let's look at that first.12+So how do you get all that on your computer quickly? There are many ways you13+could do that, but the most kick-ass method is virtualenv, so let's have a look14+at that first.15 16-Either way, you will need Python 2.5 or higher to get started, so be sure17-to have an up to date Python 2.x installation. At the time of writing,18-the WSGI specification is not yet finalized for Python 3, so Flask cannot19-support the 3.x series of Python.16+You will need Python 2.5 or higher to get started, so be sure to have an17+up-to-date Python 2.x installation. At the time of writing, the WSGI18+specification has not yet been finalized for Python 3, so Flask cannot support19+the 3.x series of Python.20 21 .. _virtualenv:22 23 virtualenv24 ----------25 26-Virtualenv is probably what you want to use during development, and in27-production too if you have shell access there.26+Virtualenv is probably what you want to use during development, and if you have27+shell access to your production machines, you'll probably want to use it there,28+too.29 29-What problem does virtualenv solve? If you like Python as I do,30-chances are you want to use it for other projects besides Flask-based31-web applications. But the more projects you have, the more likely it is32-that you will be working with different versions of Python itself, or at33-least different versions of Python libraries. Let's face it; quite often34-libraries break backwards compatibility, and it's unlikely that any serious35-application will have zero dependencies. So what do you do if two or more36-of your projects have conflicting dependencies?30+What problem does virtualenv solve? If you like Python as much as I do,31+chances are you want to use it for other projects besides Flask-based web32+applications. But the more projects you have, the more likely it is that you33+will be working with different versions of Python itself, or at least different34+versions of Python libraries. Let's face it: quite often libraries break35+backwards compatibility, and it's unlikely that any serious application will36+have zero dependencies. So what do you do if two or more of your projects have37+conflicting dependencies?38 38-Virtualenv to the rescue! It basically enables multiple side-by-side39-installations of Python, one for each project. It doesn't actually40-install separate copies of Python, but it does provide a clever way41-to keep different project environments isolated.39+Virtualenv to the rescue! Virtualenv enables multiple side-by-side40+installations of Python, one for each project. It doesn't actually install41+separate copies of Python, but it does provide a clever way to keep different42+project environments isolated. Let's see how virtualenv works.43 43-So let's see how virtualenv works!44-44 If you are on Mac OS X or Linux, chances are that one of the following two45 commands will work for you::46 47 $ sudo easy_install virtualenv1 unmodified line49 or even better::50 51 $ sudo pip install virtualenv52 54-One of these will probably install virtualenv on your system. Maybe it's55-even in your package manager. If you use Ubuntu, try::53+One of these will probably install virtualenv on your system. Maybe it's even54+in your package manager. If you use Ubuntu, try::55 56 $ sudo apt-get install python-virtualenv57 58 If you are on Windows and don't have the `easy_install` command, you must59 install it first. Check the :ref:`windows-easy-install` section for more61-information on how to do that. Once you have it installed, run the62-same commands as above, but without the `sudo` prefix.60+information about how to do that. Once you have it installed, run the same61+commands as above, but without the `sudo` prefix.62 63 Once you have virtualenv installed, just fire up a shell and create64 your own environment. I usually create a project folder and an `env`65 folder within::3 unmodified lines69 $ virtualenv env70 New python executable in env/bin/python71 Installing setuptools............done.72 74-Now, whenever you want to work on a project, you only have to activate75-the corresponding environment. On OS X and Linux, do the following::73+Now, whenever you want to work on a project, you only have to activate the74+corresponding environment. On OS X and Linux, do the following::75 76 $ . env/bin/activate77 79-(Note the space between the dot and the script name. The dot means that80-this script should run in the context of the current shell. If this command81-does not work in your shell, try replacing the dot with ``source``.)78+(Note the space between the dot and the script name. The dot means that this79+script should run in the context of the current shell. If this command does80+not work in your shell, try replacing the dot with ``source``)81 82 If you are a Windows user, the following command is for you::83 84 $ env\scripts\activate85 87-Either way, you should now be using your virtualenv (see how the prompt of86+Either way, you should now be using your virtualenv (notice how the prompt of87 your shell has changed to show the virtualenv).88 90-Now you can just enter the following command to get Flask activated in91-your virtualenv::89+Now you can just enter the following command to get Flask activated in your90+virtualenv::91 92 $ easy_install Flask93 95-A few seconds later you are good to go.94+A few seconds later and you are good to go.95 96 97 System-Wide Installation98 ------------------------2 unmodified lines101 `easy_install` with root privileges::102 103 $ sudo easy_install Flask104 106-(Run it in an Admin shell on Windows systems and without `sudo`.)105+(On Windows systems, run it in a command-prompt window with administrator106+privleges, and leave out `sudo`.)107 108 109 Living on the Edge110 ------------------111 112 If you want to work with the latest version of Flask, there are two ways: you113-can either let `easy_install` pull in the development version, or tell it114-to operate on a git checkout. Either way, virtualenv is recommended.113+can either let `easy_install` pull in the development version, or you can tell114+it to operate on a git checkout. Either way, virtualenv is recommended.115 116 Get the git checkout in a new virtualenv and run in development mode::117 118 $ git clone http://github.com/mitsuhiko/flask.git7 unmodified lines126 ...127 Finished processing dependencies for Flask128 129 This will pull in the dependencies and activate the git head as the current130-version inside the virtualenv. Then you just have to ``git pull origin``131-to get the latest version.130+version inside the virtualenv. Then all you have to do is run ``git pull131+origin`` to update to the latest version.132 133 To just get the development version without git, do this instead::134 135 $ mkdir flask10 unmodified lines146 147 `easy_install` on Windows148 -------------------------149 150-On Windows, installation of `easy_install` is a little bit trickier because151-slightly different rules apply on Windows than on Unix-like systems, but152-it's not difficult. The easiest way to do it is to download the153-`ez_setup.py`_ file and run it. The easiest way to run the file is to154-open your downloads folder and double-click on the file.150+On Windows, installation of `easy_install` is a little bit trickier, but still151+quite easy. The easiest way to do it is to download the `ez_setup.py`_ file152+and run it. The easiest way to run the file is to open your downloads folder153+and double-click on the file.154 155 Next, add the `easy_install` command and other Python scripts to the156 command search path, by adding your Python installation's Scripts folder157 to the `PATH` environment variable. To do that, right-click on the159-"Computer" icon on the Desktop or in the Start menu, and choose160-"Properties". Then, on Windows Vista and Windows 7 click on "Advanced System161-settings"; on Windows XP, click on the "Advanced" tab instead. Then click162-on the "Environment variables" button and double-click on the "Path"163-variable in the "System variables" section. There append the path of your164-Python interpreter's Scripts folder; make sure you delimit it from165-existing values with a semicolon. Assuming you are using Python 2.6 on158+"Computer" icon on the Desktop or in the Start menu, and choose "Properties".159+Then click on "Advanced System settings" (on Windows XP, click on the160+"Advanced" tab instead). Then click on the "Environment variables" button and161+double-click on the "Path" variable in the "System variables" section. There162+append the path of your Python interpreter's Scripts folder. Be sure to delimit163+it from existing values with a semicolon. Assuming you are using Python 2.6 on164 the default path, add the following value::165 166 ;C:\Python26\Scripts167 170-Then you are done. To check that it worked, open the Command Prompt and171-execute ``easy_install``. If you have User Account Control enabled on172-Windows Vista or Windows 7, it should prompt you for admin privileges.168+And you are done! To check that it worked, open the Command Prompt and execute169+``easy_install``. If you have User Account Control enabled on Windows Vista or170+Windows 7, it should prompt you for administrator privileges.171 172 173 .. _ez_setup.py: http://peak.telecommunity.com/dist/ez_setup.py