Help with Django Djitney

Hi, I have been learning python3 over the past year and have progressed onto learning Django. I am attempting the project Django Djitney, Writing More Views | Codecademy

I have completed the step to create the lines views:

from django.shortcuts import render
from .models import Line, Station, Stop
from .forms import  StopForm, LineForm, StationForm
# Add your imports below:
from django.views.generic import TemplateView, ListView
from django.views.generic.edit import CreateView, UpdateView, DeleteView

class HomeView(TemplateView):
  template_name = "routes/home.html"

  def get_context_data(self):
    context = super().get_context_data()
    context["lines"] = Line.objects.all()
    context["stations"] = Station.objects.all()
    context["stops"] = Stop.objects.all()
    return context

# Create your views here.
class LinesView(ListView):
  model = Line
  template_name = "routes/lines.html"

class CreateLineView(CreateView):
  model = Line
  template_name = "routes/add_line.html"
  form_class = LineForm

class UpdateLineView(UpdateView):
  model = Line
  template_name = "routes/update_line.html"
  form_class = LineForm

class DeleteLineView(DeleteView):
  model = Line
  template_name = "routes/delete_line.html"
  success_url = "/lines"

and created the paths in

from django.urls import path

from . import views

urlpatterns = [
  path('', views.HomeView.as_view(), name='home'),
  path('lines/', views.LinesView.as_view(), name='lines'),
  path('lines/new/', views.CreateLineView.as_view(), name='create_line'),
  path('lines/<pk>/update/', view.UpdateLineView.as_view(), name='update_line'),
  path('lines/<pk>/delete/', views.DeleteLineView.as_view(), name='delete_line'),

I have also uncommented the Lines link is base.html:

{% load static %}
<!DOCTYPE html>
    <meta charset="utf-8" />
      rel="shortcut icon"
      href="{% static 'routes/style.css' %}"
    <link rel="preconnect" href="" />
    <title>{% block title %}Django Djitney{% endblock %}</title>
    {% block head %}{% endblock %}
    <div class="app">
        <div class="header-first-row">
            src="{% static 'routes/djitney.png' %}"
            alt="Django Djitney Logo"
          <h1 class="title">Django Djitney</h1>
        <nav class="navbar">
          <a class="nav-item" href="{% url 'home' %}">Home</a>
          <a class="nav-item" href="{% url 'lines' %}">Lines</a> 
{% comment %} <a class="nav-item" href="{% url 'stations' %}">Stations</a> {% endcomment %}
{% comment %} <a class="nav-item" href="{% url 'stops' %}">Stops</a> {% endcomment %}
      <main>{% block content %}{% endblock %}</main>

When I run this code the built in browser displays a white screen and I cant find any errors in the code. Have I missed somethng?

Any help much appreciated

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.