-
Notifications
You must be signed in to change notification settings - Fork 17
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
- Install Django
- Create Django Project
- Run your project for the first time
- Create a Django App
- Add app to INSTALLED_APPS
- Add the landing page to the app
- Make the landing page fancy with Bootstrap
- Create a machine learning model with the Iris dataset
- Create Django form to take in user input and send back model prediction
- Update model prediction with text and an image
- Define the SQLite Database Schema
- Use admin mode to see edit database
- Save Prediction data to SQLite database