This entry aims to collect all the helpful command that I always forget, but are essential to build a django project from scratch.

We’ll assume that you have Django installed already and you have strong knowledge of python. More concretely python v3.x.

The information showed here has been taken from the official Django webpage


1 create the site

2 Run the server

3 Create an app

4 Collect static

5 Data base operations

Create site


$ django-admin startproject mysite

run the server


$ python runserver

create an app


$ python startapp app

Collect static

The first time that I created any static file in my project, I thought that it was enough. I was wrong, you have to run the following script to move either the new and modified static files to the path defined in your config file.

python3 collectstatic --settings "project.settings"

Database operations

I always forget what are the scripts to migrate any change in database.

  1. Make migration
python makemigrations <appname>
  1. Migrate from specified point number
python sqlmigrate <appname> 000x
  1. Check for any problem in your project
python check
  1. Migrate all changes executing the SQL sentences
python migrate