A Complete Beginner’s Guide to Django
Welcome to the complete beginner’s guide to Django! In this series, I assume you don’t have any prior knowledge in the Python programming or Django web framework. So lets’ get started.
Install Anaconda Python Distribution
By default, Ubuntu 16.04 comes with Python 2.7 but we’ll install the latest version of Anaconda Python distribution. To download the latest version for your Mac or Windows environment visit the following link https://www.anaconda.com/download/
Those who are in Ubuntu, type the following command in the terminal.
1 |
wget https://repo.anaconda.com/archive/Anaconda3-5.2.0-Linux-x86_64.sh |
Once it’s done downloading the distribution use the following command the to install.
1 |
bash Anaconda3-5.2.0-Linux-x86_64.sh |
Make sure to agree to the terms by typing yes, during the installation process. Once the installation is finished, go ahead and close the terminal.
Creating the virtual environment in Anaconda for our Django project
Good job so far! Now let’s create our new virtual environment. So go ahead and open a new terminal and following along with me.
Let’s list all our current virtual environments using the following command
1 |
conda env list |
You should see by default you’ll have the base as your primary. let’s not touch this environment. Let’s go ahead and create a new environment for our Django project.
1 |
conda create --name bestofpython python=3.5 |
In the above command, I decided to create a virtual environment named bestofpython and I decided to use python 3.5.
now we need to activate our environment. To do that use the following command.
1 |
source activate bestofpython |
Wonderful, now let’s install Django!
1 |
conda install -c anaconda django |
Good job! You have successfully installed the Django web-framework, now let’s create our first app.
Leave a Reply
You must be logged in to post a comment.