DEV Community

ashrafZolkopli
ashrafZolkopli

Posted on

Installing Django and Start a project

On the previous post, We had already created a virtual environment where we can isolate the dependencies of each project... On this post lets now install Django and also start a new project.

from your terminal, please enter the following command


pipenv install django

this tells the virtual environment that we would like to install Django in this environment. Btw since each environment is unique to its own, each new project you need to repeat this steps.

Install Django

Once the process is done, you may now initiate Django startup template

the command is as follow


django-admin startproject ToDo .

django-admin is the command build in with django to invoke Django
startproject is to initiate django to copy django starter template
ToDo is my starter project name
the . at the end is to tell django to copy at the current directory.

in your explorer you may now see 1 new folder name Todo and also manage.py

Django startproject

now to test if your installation is correct you may now use this command to run your dev server


python manage.py runserver

Django runserver

for now you may see that Django inform us that there's 18 unapplied migrations. Don't mind this for now. In the next step we will make a few changes before we can apply those changes.

open your browser and on the URL terminal

type either

127.0.0.1:8000 or localhost:8000

Django

if you see this, Congratulation you have installed a django library, start a django project and also tested to be correct.

in the next post, you will be makeing changes to the setting so that we will be able to have a better time working in the future.

Top comments (0)