Skip to content

4. Create a Django App

Katie House edited this page Sep 14, 2020 · 1 revision

A Django App is a component in a Django project that has a specific purpose, such as a blog, a wiki, or a dashboard. Most Django starter projects only have 1 app (like in this tutorial). Django expects a certain files in each app. The following command creates those files automatically for an app called iris.

python3 manage.py startapp iris

This creates the following files:

├── iris
│   ├── __init__.py
│   ├── admin.py        # Defines app admin access to see/edit the database
│   ├── apps.py         # Controls settings specific to the iris app
│   ├── migrations      # Holds files to migrate the database to create and change database schema
│   │   └── __init__.py
│   ├── models.py       # Used to construct the database schema and queries 
│   ├── tests.py        # Provide unit tests for the app
│   └── views.py        # Defines the logic for handling HTTP requests and HTTP responses

🚫 you will rarely edit these files: apps.py

Clone this wiki locally