author | Adrien Di Mascio <Adrien.DiMascio@logilab.fr> |
Thu, 22 Oct 2009 09:30:10 +0200 | |
branch | stable |
changeset 3781 | c7ef58db0e4b |
parent 1977 | 606923dff11b |
child 4023 | eae23c40627a |
child 4212 | ab6573088b4a |
permissions | -rw-r--r-- |
0 | 1 |
# -*- coding: utf-8 -*- |
1977
606923dff11b
big bunch of copyright / docstring update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1802
diff
changeset
|
2 |
""" |
606923dff11b
big bunch of copyright / docstring update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1802
diff
changeset
|
3 |
|
606923dff11b
big bunch of copyright / docstring update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1802
diff
changeset
|
4 |
:organization: Logilab |
606923dff11b
big bunch of copyright / docstring update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1802
diff
changeset
|
5 |
:copyright: 2001-2009 LOGILAB S.A. (Paris, FRANCE), license is LGPL v2. |
606923dff11b
big bunch of copyright / docstring update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1802
diff
changeset
|
6 |
:contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr |
606923dff11b
big bunch of copyright / docstring update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1802
diff
changeset
|
7 |
:license: GNU Lesser General Public License, v2.1 - http://www.gnu.org/licenses |
606923dff11b
big bunch of copyright / docstring update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1802
diff
changeset
|
8 |
""" |
0 | 9 |
import os |
10 |
os.environ["DJANGO_SETTINGS_MODULE"] = 'data.settings' |
|
11 |
||
12 |
from django import template |
|
13 |
||
14 |
||
15 |
def encode_output(self, output): |
|
16 |
# Check type so that we don't run str() on a Unicode object |
|
17 |
if not isinstance(output, basestring): |
|
18 |
return unicode(output) |
|
19 |
return output |
|
20 |
||
21 |
template.VariableNode.encode_output = encode_output |
|
22 |
||
23 |
from cubicweb.common.view import StartupView |
|
24 |
||
25 |
INDEX_TEMPLATE = template.Template(u''' |
|
26 |
<h1>hellĂ´ {{ user.login }}</h1> |
|
27 |
''') |
|
28 |
||
29 |
class MyIndex(StartupView): |
|
30 |
id = 'index' |
|
1802
d628defebc17
delete-trailing-whitespace + some copyright update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
31 |
|
0 | 32 |
def call(self): |
33 |
ctx = template.Context({'user': self.req.user}) |
|
34 |
return INDEX_TEMPLATE.render(ctx) |