from parler.models import TranslatableModel, TranslatedFields
from django.db import models
.......
class New(TranslatableModel):
alias = models.CharField(max_length=200, verbose_name="Алиас")
category = models.ForeignKey(Category, verbose_name="Категория")
status = models.BooleanField(verbose_name="Статус", default=0)
create_date = models.DateTimeField(default=timezone.now(), verbose_name="Дата создания")
translations = TranslatedFields(
title=models.CharField(max_length=200, verbose_name="Заголовок"),
text=models.TextField(verbose_name='Текст'),
short_text=models.CharField(max_length=200, verbose_name="Краткий текст"),
meta_keywords=models.CharField(max_length=200, blank=True, verbose_name="Мета ключивые слова"),
meta_descriptions=models.CharField(max_length=200, blank=True, verbose_name="Мета описание")
)
.......
......
File "/usr/lib/python3.5/gettext.py", line 297, in _parse
self.plural = c2py(plural)
File "/usr/lib/python3.5/gettext.py", line 76, in c2py
raise ValueError('plural forms expression could be dangerous')
ValueError: plural forms expression could be dangerous
</code
MIDDLEWARE_CLASSES = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.locale.LocaleMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
]
LANGUAGE_CODE = 'kz'
USE_I18N = True
USE_L10N = True
ugettext = lambda s: s
LANGUAGES = [
('kz', ugettext('KZ')),
('en', ugettext('English')),
]
server {
listen 80 default_server;
listen [::]:80 default_server;
root /var/www/html;
index index.php index.html index.htm index.nginx-debian.html;
server_name localhost;
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ =404;
}
location /phpmyadmin {
root /usr/share/;
index index.php index.html index.htm;
location ~ \.php$ {
try_files $uri = 404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
}
location ~ ^/phpmyadmin/(.+\.php)$ {
try_files $uri =404;
root /usr/share/;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include /etc/nginx/fastcgi_params;
}
location ~* ^/phpmyadmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ {
root /usr/share/;
}
}
location /phpMyAdmin {
rewrite ^/* /phpmyadmin last;
}
}