The goal here is to get django installed. Stretch goals, dealt with later, are a) to get django-based website running locally and b) to do lots of cool pythonic things in the background.
Based on further exploration of how these things work, I am amazed how complicated this is. And the documentation is basically written for someone with complete conceptual understanding of the software, who just forgot the commands they need. Not that beginner-friendly.
Sources
Dependencies
Make sure python is installed. And the other stuff.sudo apt-get install python3.5 sudo apt-get install python-pip sudo pip install virtualenv
Create your virtualenv (src)
Apparently, it's good to store your virtualenvs all in the same place. The recommended location is ./.virtualenvs, so that's what we'll use.
mkdir ~/.virtualenvs python3 -m venv ~/.virtualenvs/myfirstdjangowebsite
sudo apt-get install python3-pip sudo pip3 install virtualenv virtualenv --python=`which python3` ~/.virtualenvs/myfirstdjangowebsiteNow activate the virtualenv. If the first command doesn't work, use the second. Remember: you have to activate the virtualenv in every new terminal window.
source ~/.virtualenvs/myfirstdjangowebsite/bin/activate . ~/.virtualenvs/myfirstdjangowebsite/bin/activate
Install Django
Once that virtualenv is set up, install django.
pip install Django
Django is now available within the virtualenv you set up.
No comments:
Post a Comment