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?
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:
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.