**Hello world**
Initial Setup
First, create a directory named helloworld
.
1 | $ cd ~/desktop |
Create a new virtual environment using pipenv
, install Django and then activate it.
1 | $ pipenv install django==2.1 |
Then create a helloworld-project using command below.
(helloworld) $ django-admin startproject helloworld_project .
Using this command to run the project.
(helloworld) $ python manage.py runserver
Then visit local host to see the welcome page of django.
The above command is just the same as Django #1, and every time we create a new project, we need to make the project have its own virtual environment, we need to activate the pipenv
first, then install django
.