-
Notifications
You must be signed in to change notification settings - Fork 0
/
landing.py
executable file
·58 lines (45 loc) · 1.38 KB
/
landing.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
58
#!/usr/bin/env python
from importd import d
d( # configure django
DEBUG=True,
SMART_RETURN=True,
MIDDLEWARE_CLASSES=(
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
# 'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
),
INSTALLED_APPS=[
# 'django_extensions',
# 'django.contrib.auth',
# 'django.contrib.contenttypes',
# 'django.contrib.sessions',
# 'django.contrib.admin',
'debug_toolbar',
'crispy_forms',
# project apps
'mailing',
],
CRISPY_TEMPLATE_PACK='bootstrap3',
STATICFILES_DIRS=['static', ],
)
var = {'paises': '6',
'cidades': '231',
'pedidos': '5887',
'anjos': '1450',
}
@d('/')
def index(request):
return 'index.html', var
@d('/en/')
def index_en(request):
return 'index-en.html', var
@d('/es/')
def index_es(request):
return 'index-es.html', var
@d('/view_template/<word:name>', name='view_template') # named urls
def real_index(request, name):
return name+'.html'
if __name__ == '__main__':
d.main()