· 9 years ago · Aug 22, 2016, 08:12 AM
1import os
2
3from django.utils.translation import ugettext_lazy as _
4
5BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
6
7SECRET_KEY = '-6n@y00j+-a*8%2lmxrghi&4ld8shgrtuj)cuwdzq94acmx22_'
8
9DEBUG = True
10
11ALLOWED_HOSTS = []
12
13INSTALLED_APPS = [
14 'django.contrib.admin',
15 'django.contrib.auth',
16 'django.contrib.contenttypes',
17 'django.contrib.sessions',
18 'django.contrib.messages',
19 'django.contrib.staticfiles',
20 'polls.apps.PollsConfig'
21]
22
23MIDDLEWARE = [
24 'django.middleware.security.SecurityMiddleware',
25 'django.contrib.sessions.middleware.SessionMiddleware',
26 'django.middleware.locale.LocaleMiddleware',
27 'django.middleware.common.CommonMiddleware',
28 'django.middleware.csrf.CsrfViewMiddleware',
29 'django.contrib.auth.middleware.AuthenticationMiddleware',
30 'django.contrib.messages.middleware.MessageMiddleware',
31 'django.middleware.clickjacking.XFrameOptionsMiddleware',
32]
33
34ROOT_URLCONF = 'sampleproject.urls'
35
36TEMPLATES = [
37 {
38 'BACKEND': 'django.template.backends.django.DjangoTemplates',
39 'DIRS': [],
40 'APP_DIRS': True,
41 'OPTIONS': {
42 'context_processors': [
43 'django.template.context_processors.debug',
44 'django.template.context_processors.request',
45 'django.contrib.auth.context_processors.auth',
46 'django.contrib.messages.context_processors.messages',
47 'django.template.context_processors.i18n'
48 ],
49 },
50 },
51]
52
53WSGI_APPLICATION = 'sampleproject.wsgi.application'
54
55LANGUAGE_CODE = 'en-us'
56
57TIME_ZONE = 'UTC'
58
59USE_I18N = True
60
61USE_L10N = True
62
63USE_TZ = True
64
65LANGUAGES = [
66 ('fi-FI', _('Finnish')),
67 ('en', _('English')),
68]
69
70LOCALE_PATHS = [
71 os.path.join(BASE_DIR, 'locale'),
72]
73
74urlpatterns += i18n_patterns(
75 url(r'^$', home, name='home'),
76 url(r'^admin/', include(admin.site.urls)),
77 url(r'^polls/', include('polls.urls')),
78)
79
80Traceback (most recent call last):
81 File "./manage.py", line 22, in <module>
82 execute_from_command_line(sys.argv)
83 File "/project/Myapps/for_sample/lib/python3.4/site-packages/django/core/management/__init__.py", line 367, in execute_from_command_line
84 utility.execute()
85 File "/project/Myapps/for_sample/lib/python3.4/site-packages/django/core/management/__init__.py", line 359, in execute
86 self.fetch_command(subcommand).run_from_argv(self.argv)
87 File "/project/Myapps/for_sample/lib/python3.4/site-packages/django/core/management/base.py", line 305, in run_from_argv
88 self.execute(*args, **cmd_options)
89 File "/project/Myapps/for_sample/lib/python3.4/site-packages/django/core/management/base.py", line 356, in execute
90 output = self.handle(*args, **options)
91 File "/project/Myapps/for_sample/lib/python3.4/site-packages/django/core/management/commands/makemessages.py", line 361, in handle
92 potfiles = self.build_potfiles()
93 File "/project/Myapps/for_sample/lib/python3.4/site-packages/django/core/management/commands/makemessages.py", line 393, in build_potfiles
94 self.process_files(file_list)
95 File "/project/Myapps/for_sample/lib/python3.4/site-packages/django/core/management/commands/makemessages.py", line 488, in process_files
96 self.process_locale_dir(locale_dir, files)
97 File "/project/Myapps/for_sample/lib/python3.4/site-packages/django/core/management/commands/makemessages.py", line 507, in process_locale_dir
98 build_file.preprocess()
99 File "/project/Myapps/for_sample/lib/python3.4/site-packages/django/core/management/commands/makemessages.py", line 113, in preprocess
100 content = templatize(src_data, self.path[2:])
101 File "/project/Myapps/for_sample/lib/python3.4/site-packages/django/utils/translation/__init__.py", line 214, in templatize
102 return _trans.templatize(src, origin)
103 File "/project/Myapps/for_sample/lib/python3.4/site-packages/django/utils/translation/trans_real.py", line 670, in templatize
104 "%s (%sline %d)" % (t.contents, filemsg, t.lineno)
105SyntaxError: Translation blocks must not include other block tags: blocktrans count var|length as count (file htmlcov/_project_Myapps_for_sample_lib_python3_4_site-packages_django_templatetags_i18n_py.html, line 1073)