thanks for taking a moment to try and help me out. Haven't done much coding in many years, switched careers for some reason.. Decided to play with Django, everything was going fine, and I can't figure out this URL/slug problem. I've got some links, first.

It's explained [on their GitHub rep](https://github.com/leifos/tango_with_django_2/blob/master/manuscript/chapter6-models-templates-views.md) but I can't figure it out. I've also used [this handy site](https://www.tangowithdjango.com/book17/chapters/models_templates.html) and am still in the dark.

I Know its relatively simple, just having a hard time finding up to date code and books, and I've been frustrating myself on it for too long to quit. It's got to be an error with my URL's, I just don't know what though. So, have a laugh at my expense (seriously, you should have heard Linode support when I logged into the wrong account and deleted the wrong server.. they have excellent support!) and help me amuse myself a bit through this pandemic, because I'm mostly playing with stufff as part of a bigger project I started a while before I quit computer science and went into welding..

Basically, add a page to a category. Better looking URL's with slugs, no problem, until I try to access outside of /admin with the slug. I've basically got it text for text, and am getting this:
Using the URLconf defined in first\_project.urls, Django tried these URL patterns, in this order:
404
[name='index']
rango/
admin/
category/slug:category\_name\_slug/ [name='category']
^media/(?P.\*)$
The current path, category/useless/, didn't match any of these.

I get that when I try to access localhost/rango/category/category-name-slug, or localhost/category/category-name-slug

Here is my project urls.py

```
from django.contrib import admin
from django.urls import path
from django.urls import include
from django.conf import settings
from django.conf.urls.static import static

from rango import views

urlpatterns = [
path('', views.index, name='index'),
path('rango/', include('rango.urls')),
path('admin/', admin.site.urls),
path('category/slug:category_name_slug/', views.category, name='category'), 
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)

```

And this is from my app urls.py

```
from django.urls import path
from rango import views
app_name='rango'

urlpatterns = [ 
     path('', views.index, name='index'), 
     path('category/slug:category_name_slug/', views.category, name='category'), 
 ]

```

And a snippet from my index.html file, because I can't get category.html to load anywhere without a 404, I can get the slug name to show up beside the category name, if you're wondering what on earth I'm doing.

```
{% if categories %}
<ul>
{% for category in categories %}
<li><a href="category/{{ category.slug }}/">;{{ category.name }}  {{ category.slug }};</a>
</li>
{% endfor %}
</ul>
{% else %}
{% endif %}

```

and last, my app's views.py

```
from django.shortcuts import render
from rango.models import Category
from rango.models import Page

def index(request):
category_list = Category.objects.order_by( '-likes' )[:50]
context_dict = { 'categories': category_list }
return render(request, 'rango/index.html', context_dict)

 def category(request, category_name_slug):
context_dict = {}

category = Category.objects.get(slug=category_name_slug)
context_dict['category_name'] = category.name
pages = Page.objects.filter(category=category)
context_dict['pages'] = pages

context_dict['category'] = category
except Category.DoesNotExist:
return render(request, 'rango/category.html', context_dict)

```