-
Notifications
You must be signed in to change notification settings - Fork 17
12. Use admin mode to see edit database
Katie House edited this page Sep 15, 2020
·
1 revision
First you must register your model with Django admin. To do this, edit the iris/admin.py
file with the following:
from django.contrib import admin
from .models import Predictions
@admin.register(Predictions)
class PredictionsAdmin(admin.ModelAdmin):
pass
Now, create a superuser with the following command:
python3 manage.py createsuperuser
!! Do not forget your admin username/password !!
To access the admin site run the server and then go to: http://localhost:8000/admin
python3 manage.py runserver
You should see the following login where you can enter your credentials:
Once you enter your admin credentials, you should see your "Predictions" table under "IRIS". You can add to your table by clicking the "Add" button and entering a new row in your database.
- 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