Running localhost:8000/random-string returns "page not found"
I believe my code is all running smoothly because if it wasn't I don't think when I run manage.py runserver it will load my local host successfully.
There's another post which I believe the issue is similar and pointed to something in the codes environment not being set up correctly. I've tried to follow the answer from other issue but that didn't quite work for me.
To provide more context this is how the error message looks like in my CMD:
financio>manage.py runserver
Watching for file changes with StatReloader
Performing system checks...
System check identified no issues (0 silenced).
September 12, 2019 - 17:37:26
Django version 2.2.5, using settings 'financio.settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CTRL-BREAK.
Not Found: /random-string
[12/Sep/2019 17:37:30] "GET /random-string HTTP/1.1" 404 2327
Within my budget folder which is nested in the parent folder I have my urls.py:
from django.contrib import admin
from django.urls import path
from . import views
urlpatterns = [
path('', views.project_list, name='list'),
path('<slug:project:slug>', views.project_detail, name='detail')
]
When I run localhost:8000/random-string it is meant to load the following page project-detail.html:
{% extends 'budget/base.html' %}
{% block content %}
<div class="container">
<section class="section section-stats">
<div class="row">
<div class="col l4">
<div class="card-panel">
<h6>Savings goal</h6>
<h1>£5000</h1>
</div>
</div>
<div class="col l4">
<div class="card-panel">
<h6>Monthly Budget</h6>
<h1>£500</h1>
</div>
</div>
<div class="col l4">
<div class="card-panel">
<h6>Total Savings</h6>
<h1>£2500</h1>
</div>
</div>
</div>
</section>
</div>
{% endblock %}
Any suggestions as to why it isn't loading?
Change path('<slug:project:slug>', views.project_detail, name='detail')
to path('<slug:project>', views.project_detail, name='detail')
.