-
Notifications
You must be signed in to change notification settings - Fork 0
/
views.py
29 lines (26 loc) · 944 Bytes
/
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
# Create your views here.
from django.conf import settings
from utils import mixl_import
from django.http import HttpResponse, Http404
from django.conf import settings
def mixl_css(request, filename):
"""
mixl_css view
- THIS SHOULD NOT BE USED IN PRODUCTION, just for development
attempts to locate a css file along the MIXL_PATHS and then
parses and returns the content
in production, please use the management commands to compile
your mixl css files into your MEDIA_ROOT.
"""
paths = getattr(settings, 'MIXL_PATHS', ['./'])
#try:
context = {
'MEDIA_URL':settings.MEDIA_URL
}
template = mixl_import(filename, paths, context=context)
output = template.output(context)
#if output is None:
# raise Http404
#except IOError:
# raise Http404
return HttpResponse(content=output, mimetype='text/css', status=200)