Creating My First Django Application Part 1

Ridiculously fast.

Reassuringly secure.

Exceedingly scalable.

How to get Django ?

Option 1 : Get the latest official version

pip install Django==3.0.3

Option 2 : Get the latest development version

git clone

Installing Django from source code

  1. Extract the source code from the downloaded gzipped tarball
  2. Open the terminal and change directory to the django source code folder and then run
python install
python -c “import django; print(django.get_version())"

Database Setup

  1. MySQL (
  2. PostgreSQL (
  3. SQLite 3 (
  4. Oracle (
  5. MongoDb (
  6. GoogleAppEngine Datastore (

Creating project

django-admin startproject “myproject”
Structure of a Project

Project Structure

  • — This file is kind of your project local django-admin for interacting with your project via command line (start the development server, sync db…). To get a full list of command accessible via you can use the code −
  • myproject subfolder — This folder is the actual python package of your project. It contains four files i.e,,,
python help
Available list of commands
python runserver

Creating an Application

python startapp myapp
Structure of an Application

Application Structure

  • — Just to make sure python handles this folder as a package, because of this you can import your application and its sub modules to the other part of application / project
  • — This file helps you make the app modifiable in the admin interface. file are use to display your models in django admin panel also you can customize your admin panel using file.
  • — This is where all the application models are stored. A model is a class that represents table or collection in our DB, and where every attribute of the class is a field of the table or collection. Models are defined in the app/
  • — This is where your unit tests are. Tests are simple routines that check the operation of your code.
  • — This is where your application views are. A view function, or “view” for short, is simply a Python function that takes a web request and returns a web response. This response can be the HTML contents of a Web page, or a redirect, or a 404 error, or an XML document, or an image, etc.
  3. Django Unleashed — Book by Andrew Pinkham



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store