server {
listen 80;
server_name www.site.ru;
rewrite ^ http://site.ru$request_uri?;
}
server {
listen 80;
server_name site.ru;
root /var/www/site.ru;
index index.php;
charset UTF-8;
gzip on;
gzip_http_version 1.1;
gzip_vary on;
gzip_comp_level 6;
gzip_proxied any;
gzip_types text/plain text/xml text/css application/x-javascript;
access_log /var/log/nginx/site.ru.access.log;
error_log /var/log/nginx/site.ru.error.log;
location /nginx_status {
stub_status on;
access_log off;
}
location / {
try_files $uri $uri/ /index.php?q=$uri&$args;
}
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass php;
fastcgi_param SCRIPT_FILENAME /var/www/site.ru$fastcgi_script_name;
fastcgi_param DOCUMENT_ROOT /var/www/site.ru;
fastcgi_index index.php;
include fastcgi_params;
}
location ~ ^/(status|ping)$ {
include /etc/nginx/fastcgi_params;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_param SCRIPT_FILENAME $fastcgi_script_name;
allow 127.0.0.1;
deny all;
}
}
CKEDITOR_UPLOAD_PATH = "filer_public/"
CKEDITOR_CONFIGS = {
"default": {
"removePlugins": "stylesheetparser",
'allowedContent': True,
'toolbar_Full': [
['Styles', 'Format', 'Bold', 'Italic', 'Underline', 'Strike', 'Subscript', 'Superscript', '-', 'RemoveFormat' ],
['Image', 'Flash', 'Table', 'HorizontalRule'],
['TextColor', 'BGColor'],
['Smiley','sourcearea', 'SpecialChar'],
[ 'Link', 'Unlink', 'Anchor' ],
[ 'NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', '-', 'Blockquote', 'CreateDiv', '-', 'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock', '-', 'BidiLtr', 'BidiRtl', 'Language' ],
[ 'Source', '-', 'Save', 'NewPage', 'Preview', 'Print', '-', 'Templates' ],
[ 'Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord', '-', 'Undo', 'Redo' ],
[ 'Find', 'Replace', '-', 'SelectAll', '-', 'Scayt' ],
[ 'Maximize', 'ShowBlocks' ]
],
}
}
class TechInfo(models.Model):
title = models.CharField(_(u'заголовок'), max_length=255)
def __unicode__(self):
return self.title
class Meta:
ordering = ('title',)
class ProductTechInfo(models.Model):
"""техническая информация для продуктов
"""
product = models.ForeignKey(Product, verbose_name=_(u"товар"), related_name="techinfo")
name = models.ForeignKey(TechInfo, verbose_name=_(u"имя"), related_name="name")
value = models.TextField(_(u'значение'), blank=True)
separator = models.BooleanField(_(u'заголовок?'), default=False)
position = models.SmallIntegerField(_(u'позиция'), default=999)
def __unicode__(self):
return u"%s" % (self.name)
class Meta:
ordering = ('position',)
verbose_name = _(u'техническая информация')
verbose_name_plural = _(u'техническая информация')