Add this to your urls.py at the top :
from d
h5bp.urls
import
urlpatterns as dh5bp
_urls
from d
h5bp.urls
import
urlpatterns as dh5bp
_urls
$ sudo a2dissite 000-default && sudo a2ensite mysite
$ sudo /etc/init.d/apache2 restart
$ echo '<b>Hello! It is working!</b>' > /home/user/public_html/index.html
Finally, browse to http://localhost/
$ vim /etc/apache2/sites-available/mysite
Inside mysite
WSGIPythonPath /home/user/site:/home/user/.virtualenvs/test/lib/python2.7/site-packages WSGIPythonHome /home/user/.virtualenvs/test
<VirtualHost *:80> <Directory /home/user/.virtualenvs/test/lib/python2.7/site-packages> Options Indexes Order deny,allow Allow from all </Directory> WSGIScriptAlias /site /home/user/site/site/wsgi.py <Directory /home/user/site/site> <Files wsgi.py> Order deny,allow Allow from all </Files> </Directory> Alias /static/ /home/user/site/static/ <Location "/static/"> Options -Indexes </Location >
$ sudo apt-get install libmysqlclient-dev
$ sudo apt-get install python-dev
pip install mysql-python
ENJOY!!!!!!!
curl -O http://python-distribute.org/distribute_setup.py
sudo python distribute_setup.py
sudo easy_install pip
pip completion --bash >> ~/.bashrc
and run source ~/.bashrc
to enablesudo pip install virtualenv
sudo pip install virtualenvwrapper
export WORKON_HOME=`~/.virtualenvs`
mkdir $WORKON_HOME
echo "export WORKON_HOME=$WORKON_HOME" >> ~/.bashrc
Setup virtualenvwrapper
echo "source /usr/local/bin/virtualenvwrapper.sh" >> ~/.bashrc
echo "export PIP_VIRTUALENV_BASE=$WORKON_HOME" >> ~/.bashrc
source ~/.bashrc
mkvirtualenv test
python -c "import sys; print sys.path"
/home/user/.virtualenv/...
because it now doesn't use your system site-packages.
deactivate
workon test
rmvirtualenv test
To Install Django
$ pip install django
$ which django-admin.py
$ django-admin.py startproject django_project
ENJOY!!!!!!