Aswin Murugesh
Aswin Murugesh

Reputation: 11070

django default page when debug=True

Is there any way to redirect all unmatched urls to a certain view in django? I can't use 404 page normally, as i have Debug = True. Is there any way to do so?

Upvotes: 0

Views: 309

Answers (1)

yuvi
yuvi

Reputation: 18427

It's kind of a hack, but it's simple enough - add a url that will match anything at the end of your other urls

    url(r'^.*', 'myapp.my_custom_errorview'),

Remembre that yiou have to put it last, else it will override all other urls.

Upvotes: 1

Related Questions