[Fixed]-How to write view for any HTML name?

1👍

It’s in the tutorial.

urlpatterns = [
  url(r'^(?P<page>\d+)\.html$', views.display)
]

def display(request, page):
  verify(page) # Implementation left as an exercise for the reader
  return render(request, '{}.html'.format(page))

Leave a comment