Very often I faced with problems while installing MySQL module for python web applications on virtual environment.
Here I'll describe steps for successful installation.
First of all, be sure that you have MySQL server installed:
sudo apt-get install mysql-server
As we will use virtual environment, let's install it also:
sudo apt-get install python-virtualenv
Now we will create virtualenv in project root folder and activate it:
mkdir myproject && cd myproject
After activating of virtualenv you should see "(venv)" on the start of the promt (e,g,(venv)my-user@web-server:).
Now all packages that wil...
I've started "Django stories" topic which will highlight django project development process from the begining step by step.
In this article we'll describe how to deploy django with python3 to virtualenv.
Let's start from virtualenv. So, virtualenv is an isolated working copy of Python which allows you to work on a specific project without worry of affecting other projects.
apt-get install python3 python-pip
pip install virtualenv
Create your environment:
mkdir /opt/myenv && cd /opt/myenv
virtualenv --no-site-packages -p /usr/bin/python3 myenv
After this command you'll see next dirs structure:
Continuing Alex's idea I decided to describe such useful thing as virtualenwrapper. It allows simple managing of all your virtual environments.
Here is its advantages (from the official page):
Organizes all of your virtual environments in one place.
Wrappers for managing your virtual environments (create, delete, copy).
Use a single command to switch between environments.
Tab completion for commands that take a virtual environment as argument.
User-configurable hooks for all operations.
Plugin system for more creating sharable extensions.
$ pip install virtualenvwrapper
$ export WORKON_HOME=~/venvs # make variable for path to your virtual ...