mirror of
https://github.com/fergalmoran/dss.git
synced 2026-03-06 21:56:23 +00:00
500 debugging...
This commit is contained in:
@@ -23,7 +23,7 @@ ADMINS = (
|
||||
MANAGERS = ADMINS
|
||||
AUTH_PROFILE_MODULE = 'spa.UserProfile'
|
||||
|
||||
ALLOWED_HOSTS = localsettings.ALLOWED_HOSTS if hasattr(localsettings, 'ALLOWED_HOSTS') else []
|
||||
ALLOWED_HOSTS = ['*'] #localsettings.ALLOWED_HOSTS if hasattr(localsettings, 'ALLOWED_HOSTS') else []
|
||||
DATABASES = {
|
||||
'mysql': {
|
||||
'ENGINE': 'django.db.backends.mysql',
|
||||
@@ -52,7 +52,7 @@ USE_TZ = True
|
||||
|
||||
SITE_ROOT = here('')
|
||||
MEDIA_ROOT = localsettings.MEDIA_ROOT
|
||||
STATIC_ROOT = here('static') #localsettings.STATIC_ROOT if hasattr(localsettings, 'STATIC_ROOT') else ''
|
||||
STATIC_ROOT = '/var/www/deepsouthsounds.com/static' # here('static') #localsettings.STATIC_ROOT if hasattr(localsettings, 'STATIC_ROOT') else ''
|
||||
CACHE_ROOT = localsettings.CACHE_ROOT
|
||||
|
||||
if DEBUG:
|
||||
|
||||
@@ -25,6 +25,7 @@ urlpatterns = patterns('',
|
||||
(r'^tinymce/', include('tinymce.urls')),
|
||||
url(r'^', include('spa.urls')),
|
||||
)
|
||||
handler500 = 'spa.views.debug_500'
|
||||
|
||||
if settings.DEBUG:
|
||||
from django.views.static import serve
|
||||
|
||||
@@ -39,3 +39,5 @@ urlpatterns = patterns(
|
||||
url(r'^comments/', include('django.contrib.comments.urls')),
|
||||
(r'^.*/$', 'spa.views.default')
|
||||
)
|
||||
|
||||
|
||||
|
||||
13
spa/views.py
13
spa/views.py
@@ -33,3 +33,16 @@ def default(request):
|
||||
|
||||
def upload(request):
|
||||
return render_to_response("inc/upload.html", context_instance=RequestContext(request))
|
||||
|
||||
def debug_500(request, template_name='debug_500.html'):
|
||||
"""
|
||||
500 error handler.
|
||||
|
||||
Templates: `500.html`
|
||||
Context: sys.exc_info() results
|
||||
"""
|
||||
t = loader.get_template(template_name) # You need to create a 500.html template.
|
||||
ltype,lvalue,ltraceback = sys.exc_info()
|
||||
sys.exc_clear() #for fun, and to point out I only -think- this hasn't happened at
|
||||
#this point in the process already
|
||||
return http.HttpResponseServerError(t.render(Context({'type':ltype,'value':lvalue,'traceback':ltraceback})))
|
||||
|
||||
@@ -16,4 +16,4 @@
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user