Beginners Guide to Setup Django Project

Django Project Setup

Getting Started – Django Project


  • Python installed on our system.
  • Create directory for project and ‘cd’ into project directory.
  • Create a virtual environment for django project. (Click Here for virtual environment setup tutorial.)
  • Activate the virtual environment.


After activating the virtual environment install django by running pip command.

Create Basic Django Project

Once the django installed in the system. Create the django project by running the below command.

django-admin startproject core .

After creating project your project structure looks like below.

Django Project Structure

Project Structure

  • Test-Project: The root folder of our project. Which contains all our project files and virtual environment.
  • venv: The virtual environment folder for the project.
  • core: This folder contains the files which is created by django-admin command.
    • This is an empty file. Which tells python that this directory should be considered as a Python project.
    • This file is an entry-point for ASGI-compatible webservers to serve our project.
    • This file is acts as a main settings file for our project. Which is used to configure the ‘templates’ directory, ‘static’ files directory and ‘media’ directory paths and ‘debut’ settings etc.
    • This file acts as base url routing file for the all application we create under our project.
    • This file is an entry-point for WSGI-compatible web servers to serve our project.
  • A command-line utility that lets you interact with this Django project in various ways. Like starting server, making migrations for database, creating sure user etc,.

How To Start A Server

You can start a django server using the following command.

python runserver

The default server is starting on port 8000. We can customize these by-passing arguments to runserver command.

python runserver

How To Make Migrations & Migrate Changes to Database

python makemigration

By using this command, we can make migrations for the file. file contains the database structure.

To apply changes to the database by applying below command.


In this blog post we learned how to setup a basic django project. By using this knowledge, we can extend this template to full-fledged web application in future blog posts. Happy Coding!

Leave a Reply

Your email address will not be published. Required fields are marked *