How to start Django project (1)

I know there are good websites such as Django girls and so on. They provide more accurate and useful tips and techniques to publish a web built with Django, but here I summarize the key points of the procedures which are mainly required during the whole project. I’ll start with how to start Django project.

First, we have to make virtual environment(VENV). The reason for making VENV is that we can isolate our projects settings and properties from other projects.

How to make virtual environment for Mac

$ mkdir <django_project_name> # I'll use my project name as "name"
$ cd name
$ python3 -m venv <your venv name> # I'll use myvenv
$ python3 -m venv --without-pip myvenv # when error happens

How to make virtual environment for Windows

C:\<your project directory>C:\<your python directory> -m venv myvenv

Now you’ve created the virtual environment. then we need to get inside of VENV which we will call as “activate”
For Mac

#at the same directory as above
$ source myvenv/bin/activate

For Windows

C:\<proejct dir>> myvenv\Scripts\activate

If you want to get out of this VENV

For Mac & Windows

$ deactivate

Now it is time to install Django. there are several versions of Django. You can choose any but I would recommend you to choose the LTS versions, which are supported for 3 years (as I remember) if you want further information, you could find it in the link below.

So if you decide the version of the Django (or you can just install the latest by not typing the version. and for the user of the windows forget about the “3” such as pip3, python3. these are for the mac users, you can just use pip, and python. also who had trouble install VENV with pip, need to install pip manually

$ curl | python3

You can install django by command below.

Make sure you are in the VENV.

(myvenv) $ pip3 install django==<version>

I’ll skip writing “myvenv” from here.

You can just install without version

 $ pip3 install django

which will install the latest version.

Now we are ready to go.

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.