Django Development Workflow

Derived from here

cd websites
django-admin startproject murdermystery
cd murdermystery
python3 runserver

hit ctrl+c to stop

Create a new script builder app

python3 startapp scriptbuilder
nano murdermystery/

INSTALLED_APPS = [ ‘django.contrib.admin’, ‘django.contrib.auth’, ‘django.contrib.contenttypes’, ‘django.contrib.sessions’, ‘django.contrib.messages’, ‘django.contrib.staticfiles’, ‘script_builder.apps.ScriptBuilderConfig’ ]

Update Database if necessary.

TIME_ZONE = 'America/Phoenix'

Edit URL mappings

nano murdermystery/

add to bottom

# Use include() to add paths from the catalog application
from django.urls import include

urlpatterns += [
    path('script_builder/', include('script_builder.urls')),
# Use static() to add url mapping to serve static files during development (only)
from django.conf import settings
from django.conf.urls.static import static

urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)

save and close

Now paste the following into

nano script_builder/
from django.urls import path
from . import views

urlpatterns = [

python makemigrations
python migrate
python runserver


Add models according to this page

Register models and add super user

nano script_builder/
from django.contrib import admin

# Register your models here.

from .models import Author, Genre, Book, BookInstance
python createsuperuser
python3 runserver

Go to localhost:8000/admin