Virtual enviroment (local TESTS) - JorgeFrancoIbanez/FlaskForm GitHub Wiki
As is said in the Flask Documentation, virtualenv allow you to change between different versions of Python or different versions of Python libraries to use it for different projects no only for Flask-based web applications. More information: http://docs.python-guide.org/en/latest/dev/virtualenvs/
Installation
There's actually 2 way to install it.
-
-
Via pip installation, if you already have pip just run:
- $ sudo pip install virtualenv
-
If not:
- $ sudo apt-get -y install python-pip
- $ sudo pip install virtualenv
-
-
Via package manager.
- $ sudo apt-get install python-virtualenv
Configuring your virtual environment
After installing virtualenv let's create your folder project:
+ $ mkdir myproject
+ $ cd myproject
+ $ virtualenv venv
virtualenv venv this command will create your new environment. Now you need to activate your environment and start setting up your required libraries.
+ $ . venv/bin/activate
and to deactivate it:
+ $ deactivate
For this project we need Flask and Flask-web, so let's install it.
+ $ pip install Flask flask-mysql