Skip to content

Commit

Permalink
404,403,500
Browse files Browse the repository at this point in the history
  • Loading branch information
wjdp committed Sep 26, 2014
1 parent 9d4bbe4 commit f564376
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 38 deletions.
1 change: 1 addition & 0 deletions templates_global/404.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{% extends 'base_template.html' %}
{% block content %}
<h1><i class="fa fa-exclamation-triangle red"></i> Page not found</h1>

<p>Sorry about that, if you think this is in error please contact the database administrator.</p>
{% endblock %}
23 changes: 12 additions & 11 deletions templates_global/base_template.html
Original file line number Diff line number Diff line change
@@ -1,25 +1,26 @@
{% load xsd_nav %}
{% load staticfiles %}
<!doctype html>
<html>
<head>
{% block pre_head %}{% endblock %}
<title>{% block title %}{{l10n_club.name}} Database{% endblock %}</title>
<meta charset="utf-8" />

<link rel="stylesheet" type="text/css" media="screen" href="/static/bootstrap/css/bootstrap.min.css" />
<link rel="stylesheet" type="text/css" media="screen" href="{% static 'bootstrap/css/bootstrap.min.css' %}" />

<link rel="stylesheet" type="text/css" media="screen" href="/static/bootstrap/css/bootstrap-responsive.min.css" />
<link rel="stylesheet" href="/static/css/font-awesome.min.css">
<link rel="stylesheet" type="text/css" media="screen" href="/static/css/strap.css" />
<link rel="stylesheet" type="text/css" media="screen" href="{% static 'bootstrap/css/bootstrap-responsive.min.css' %}" />
<link rel="stylesheet" href="{% static 'css/font-awesome.min.css' %}">
<link rel="stylesheet" type="text/css" media="screen" href="{% static 'css/strap.css' %}" />

<link rel="stylesheet" type="text/css" media="screen" href="/static/css/token-input-facebook.css" />
<link rel="stylesheet" type="text/css" media="screen" href="{% static 'css/token-input-facebook.css' %}" />

<script type="text/javascript" src="/static/js/jquery.js"></script>
<script type="text/javascript" src="/static/js/jquery.forms.js"></script>
<script type="text/javascript" src="/static/js/jquery.cookie.js"></script>
<script type="text/javascript" src="/static/js/jquery.tokeninput.js"></script>
<script type="text/javascript" src="/static/bootstrap/js/bootstrap.min.js"></script>
<script type="text/javascript" src="/static/js/css_extra.js"></script>
<script type="text/javascript" src="{% static 'js/jquery.js' %}"></script>
<script type="text/javascript" src="{% static 'js/jquery.forms.js' %}"></script>
<script type="text/javascript" src="{% static 'js/jquery.cookie.js' %}"></script>
<script type="text/javascript" src="{% static 'js/jquery.tokeninput.js' %}"></script>
<script type="text/javascript" src="{% static 'bootstrap/js/bootstrap.min.js' %}"></script>
<script type="text/javascript" src="{% static 'js/css_extra.js' %}"></script>

{% block post_head %}{% endblock %}
</head>
Expand Down
9 changes: 0 additions & 9 deletions templates_global/error403.html

This file was deleted.

7 changes: 5 additions & 2 deletions xSACdb/context_processors.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from django.core.urlresolvers import resolve
from django.core.urlresolvers import resolve, Resolver404
from django.conf import settings

from xSACdb.roles.functions import *
Expand All @@ -10,7 +10,10 @@ def menu_perms(request):
if request.user.is_authenticated():
u=request.user
p=u.memberprofile
current_url = resolve(request.path_info).url_name
try:
current_url = resolve(request.path_info).url_name
except Resolver404:
current_url = ''

update_request_form = UpdateRequestMake()
my_user_account_form = MyUserAccountForm()
Expand Down
12 changes: 8 additions & 4 deletions xSACdb/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
MEDIA_URL = '/media/'

# Media files (css, images etc) for development server
STATIC_DOC_ROOT = PROJECT_PATH + '/media/'
STATIC_DOC_ROOT = PROJECT_PATH + '/static/'

# Absolute path to the directory static files should be collected to.
# Don't put anything in this directory yourself; store your static files
Expand Down Expand Up @@ -137,7 +137,7 @@
'tastypie',
'geoposition',

# 'debug_toolbar',
'debug_toolbar',

'xsd_frontend',
'xsd_members',
Expand Down Expand Up @@ -173,11 +173,15 @@
'level': 'ERROR',
'filters': ['require_debug_false'],
'class': 'django.utils.log.AdminEmailHandler'
}
},
'console': {
'level': 'DEBUG',
'class': 'logging.StreamHandler',
},
},
'loggers': {
'django.request': {
'handlers': ['mail_admins'],
'handlers': ['mail_admins','console'],
'level': 'ERROR',
'propagate': True,
},
Expand Down
10 changes: 4 additions & 6 deletions xSACdb/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@
from django.contrib import admin
admin.autodiscover()

handler403='xsd_frontend.views.error403'
handler404='xsd_frontend.views.error404'

urlpatterns = patterns('',
url(r'^$', 'xsd_frontend.views.dashboard', name='dashboard'),
url(r'^update-request/$', 'xsd_frontend.views.update_request', name='update_request'),
Expand All @@ -33,9 +30,10 @@

url(r'^about/', include('xsd_about.urls')),

url(r'^media/(?P<path>.*)$', 'django.views.static.serve',
{'document_root': settings.STATIC_DOC_ROOT}),
url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
# Can be enabled for serving static files (dev only)
# url(r'^static/(?P<path>.*)$', 'django.views.static.serve',
# {'document_root': settings.STATIC_DOC_ROOT}),

url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
url(r'^admin/', include(admin.site.urls)),
)
6 changes: 0 additions & 6 deletions xsd_frontend/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,6 @@ def register(request):
form = UserRegisterForm()
return render(request,'frontend_register.html', {'form': form})

def error403(request):
return render(request, 'error403.html', status=403)
def error404(request):
return render(request, 'error404.html', status=404)


def update_request(request):
if request.POST:
form=UpdateRequestMake(request.POST)
Expand Down

0 comments on commit f564376

Please sign in to comment.