1

I have set a HTML page 500.html in my main direcroty. It will show this page when HTML 500 Internal Server Error occurs.

How can I generate this error to check if it works?

I'm gussesing I should somehow raise exception of some sort.

How do I do that?

Maciej Lach
  • 1,622
  • 3
  • 20
  • 27
aayushdagra
  • 89
  • 1
  • 4
  • 14

1 Answers1

2

Try editing the urls.py as follows:

if settings.DEBUG:
    urlpatterns += patterns('',
        (r'^500/$', 'django.views.defaults.server_error'),
    )

Then try accessing the page as follows:

http://localhost/500

http://yoursite.com/500

Murali
  • 1,084
  • 1
  • 11
  • 28