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
  • 441,113
  • 110
  • 1,021
  • 1,148
atkawa7
  • 344
  • 1
  • 5
  • 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
  • 441,113
  • 110
  • 1,021
  • 1,148