Guide

Create a django app

Project setup and a starter Django model.

This Guide is about setting up a Django project with one app.

The project

  • Create project :
django-admin startproject <name>
  • create app:
python manage.py startapp <name>
  • add the app in installed apps under settings.py
  • blank=true will accept blank entries null=True will insert NULL as default
  • migrations
python manage.py makemigrations
python manage.py migrate
  • create superuser admin
python manage.py createsuperuser
  • register models in models.py
admin.site.register(MyModel)
  • Create Generic views have to specify model, context_object_name, fields