-
Notifications
You must be signed in to change notification settings - Fork 17
7. Make the landing page fancy with Bootstrap
Katie House edited this page Sep 15, 2020
·
2 revisions
Bootstrap is a CSS framework that makes front end development easier than ever. To add Bootstrap to your app, an easy way is to copy the following into a new iris/templates/base.html
file.
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css"
integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
</head>
<body>
<div class="container">
<div class="row justify-content-center">
<div class="col-8">
<h1 class="mt-2">Iris Model Predictions</h1>
<hr class="mt-0 mb-4">
{% block content %}
{% endblock %}
</div>
</div>
</div>
</body>
</html>
Update iris/templates/home.html
to the following:
{% extends 'base.html' %}
{% block content %}
<h1>it works!</h1>
{% endblock %}
Your landing page should look like this after doing python3 manage.py runserver
:
- 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