Last active
December 14, 2015 17:38
-
-
Save stvnwlsn/5123499 to your computer and use it in GitHub Desktop.
Setup Django on Xubuntu 12-10
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#links | |
http://mysql-python.blogspot.co.uk/2012/11/is-mysqldb-hard-to-install.html | |
https://docs.djangoproject.com/en/dev/ref/databases/#mysql-notes | |
# upgrade pip | |
sudo pip install --upgrade pip | |
# close and open shell to use new pip version | |
# upgrade distribute | |
sudo pip install --upgrade distribute | |
# to use virtual environment ('sudo pip' not needed when virtualenv active) | |
sudo pip install virtualenv | |
virtualenv --no-site-packages --distribute ENV_NAME #TODO: ask about options here | |
cd ENV_NAME | |
source bin/activate | |
deactivate | |
# install mysql-python | |
# dependencies first | |
sudo apt-get install build-essential python-dev libmysqlclient-dev | |
sudo pip install mysql-python | |
# install django | |
sudo pip install django | |
# create project | |
django-admin.py startproject mysite | |
# start server | |
cd mysite | |
python manage.py runserver | |
# create mysql database | |
CREATE DATABASE mysite CHARACTER SET utf8; | |
# add database to settings.py & time zone Europe/London | |
vim mysite/settings.py | |
# create database tables and superuser account | |
python manage.py syncdb |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment