django setup with virtualenv & PyCharm
Setting up my django development (basic).
The following steps assuming that Python is installed.
- Setup a repository on Bitbucket: Ensure my development machine has access via SSH keys
-
**Install pip on development machine:** https://pip.pypa.io/en/stable/installing.html:
To install pip, securely download get-pip.py
Then run the following (which may require administrator access): <div class="highlight-python"><div class="highlight">$[sudo] python get-pip.py
</div></div>
- **Install virtualenv on the development machine:** https://virtualenv.pypa.io/en/latest/installation.html
$ [sudo] pip install virtualenv
- Create a working directory for the project:
$mkdir /path/to/project/root
- Create the virtual environment to work from:
$virtualenv /path/to/project/root/env
- Activate the virtual environment:
$source /path/to/project/root/env/bin/activate
- Install mysql-python:```
``` (env)$[sudo]apt-get install python-dev libmysqlclient-dev `````` (env)$pip install MySQL-python ``` ```
- Install django 1.7:```
(env)$pip install django==1.7
exit the virtualenv for now by:
(env)$ deactivate ```
- Install pycharm to manage the project from a GUI:
First install java: ``` $ sudo add-apt-repository ppa:webupd8team/java $ sudo apt-get update $ sudo apt-get install oracle-java8-installer $ sudo apt-get install oracle-java8-set-defaultNext install pycharm: Download from [https://www.jetbrains.com/pycharm/download/ ](https://www.jetbrains.com/pycharm/download/)or from a directory outside of your project directory:
$ wget http://download.jetbrains.com/python/pycharm-community-4.5.3.tar.gz
change to that directory and :
$ tar -xvf pycharm-community-4.5.3.tar.gz
now to launch pycharm:
$ ./pycharm-community-4.5.3/bin/pycharm.sh ```
Django 1.7, mysql-python and the pycharm editor should now be ready to use!
Next: Setting up the itstock django project http://www.davegernon.co.uk/techblog/initial-django-setup-for-itstock-project/