Skip to content

Instantly share code, notes, and snippets.

@aliceridgway
Created June 26, 2022 11:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aliceridgway/3d8bcde764780beec70c26509021d27b to your computer and use it in GitHub Desktop.
Save aliceridgway/3d8bcde764780beec70c26509021d27b to your computer and use it in GitHub Desktop.
post detail
def post_detail(request: HttpRequest, slug: str) -> HttpResponse:
post = get_object_or_404(Post, slug=slug)
context = {"post": post}
return render(request, "post_detail.html", context)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment