I didn't know how to configure 404 & 500 errors in django.
Thanks to "namnatulco" who helped me.
Here are the steps -
1.) Create 2 pages 404.html & 500.html.
2.) Place them in your modules template folder
3.) In your modules urls.conf, enter these two lines
handler404 = "myproject.mymodule.views.redirect_page_not_found"
handler500 = "myproject.mymodule.views.redirect_500_error"
4.) In your view, define the functions -
def redirect_page_not_found(request):
return render_to_response('logreg/404.html', {}, context_instance=RequestContext(request));
def redirect_500_error(request):
return render_to_response('logreg/500.html', {}, context_instance=RequestContext(request));
5.) Test it by giving some incorrect URL e.g. - www.mydomain.com/aaaaaaaaaaaaaaaa
6.) To test 500 error, inside your view, in your render_to_response, give an incorrect URL.
That's it. You should be set.