Hacking Django's Views and URLS to support your blog
Introduction
When we initially created our blog app, we had segregated our blog app to any path that started with blog/. In the case of our blog, however, its reach expands beyond a traditional blog post. In fact, we want our website to render any blog post that exists in its file tree.
Fixing our URL mapping
External Resources
- django urls:
- django disregard final slash: https://stackoverflow.com/questions/59115733/how-to-make-trailing-slash-optional-in-django
- append or remove slash: https://gregbrown.co/code/append-or-remove-slash/
- django views
- writing views including 404, https://docs.djangoproject.com/en/6.0/topics/http/views/
- https://spookylukey.github.io/django-views-the-right-way/the-pattern.html
- customizing queryset: https://stackoverflow.com/questions/22902457/django-listview-customising-queryset