Django #2

**Hello world**

Initial Setup

First, create a directory named helloworld.

1
2
3
$ cd ~/desktop  
$ mkdir helloworld
$ cd helloworld

Create a new virtual environment using pipenv, install Django and then activate it.

1
2
$ pipenv install django==2.1
$ pipenv shell

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.

I am a little tired…okay, a little lazy.
0%