UNC BACS 350

Web Apps with Python/Django

Logo

Project 5 - Superhero Database

Goals

Steps

Create a new Django project

Define Python class

hero/models.py

class Superhero(models.Model):
    name = models.CharField(max_length=20)
    identity = models.CharField(max_length=20)

Data Migrations

Enable the Admin UI

hero/admin.py

from django.contrib import admin

from .models import Superhero

admin.site.register(Superhero)

Admin Routes

hero/urls.py

from django.contrib.admin import site

urlpatterns = [
    path(r'admin/', site.urls),
]

Create Objects

Add Heroes

Add five Superheroes

Create Superhero Pages

Superhero Index

Create Images

Create Superhero Theme

Test the pages

Requirements