-
Notifications
You must be signed in to change notification settings - Fork 0
/
views.py
57 lines (48 loc) · 1.67 KB
/
views.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
import os
from django.conf import settings
from django.http import HttpResponse
from django.http import HttpResponseRedirect
from django.shortcuts import render_to_response
from django.shortcuts import redirect
from django.shortcuts import get_list_or_404
from django.shortcuts import get_object_or_404
from django.template import RequestContext
from django.utils import simplejson
def example(req):
return render_to_response('example.html', {})
def index(req):
#return render_to_response('index.html', {})
return redirect('/tourney/standings')
#
# cheating static content handlers
#
def css(req, filename):
return HttpResponse(
open('%scss/%s' % (settings.MEDIA_ROOT, filename), 'rb').read(),
mimetype='text/css'
)
def js(req, filename):
return HttpResponse(
open('%sjs/%s' % (settings.MEDIA_ROOT, filename), 'rb').read(),
mimetype='application/x-javascript'
)
def gif(req, filename):
return HttpResponse(
open('%simg/%s.gif' % (settings.MEDIA_ROOT, filename), 'rb').read(),
mimetype='image/gif'
)
def png(req, filename):
return HttpResponse(
open('%simg/%s.png' % (settings.MEDIA_ROOT, filename), 'rb').read(),
mimetype='image/png'
)
def jpeg(req, filename, extension):
return HttpResponse(
open('%simg/%s.%s' % (settings.MEDIA_ROOT, filename, extension), 'rb').read(),
mimetype='image/jpeg'
)
def jquery_ui_images(req, theme, filename):
return HttpResponse(
open('%scss/%s/images/%s.png' % (settings.MEDIA_ROOT, theme, filename), 'rb').read(),
mimetype='image/png'
)