0

I am new to django and I am having problems with my views. I would like to get all the urls with the extension .html go to a view ...app.views.test

I have:

url(r'^\. html$',views.test)
alecxe
  • 462,703
  • 120
  • 1,088
  • 1,195
atkawa7
  • 461
  • 1
  • 6
  • 13

1 Answers1

3

Just check the ending:

url(r'\.html$', views.test)

Note that a dot needs to be escaped with a backslash since the dot has a special meaning:

'.' (Dot.)

In the default mode, this matches any character except a newline.

Community
  • 1
  • 1
alecxe
  • 462,703
  • 120
  • 1,088
  • 1,195