server {
listen 80, 443;
server_name domain1.local, www.domain1.local;
rewrite https://domain2.local permanent;
}
server {
listen 80; # для понимания
server_name domain2.local, www.domain2.local;
rewrite https://domain2.local permanent;
}
server {
listen 443;
server_name domain2.local;
....
}
Из конфига видно, что при переходе на psql.site/ сервер должен читать /var/www/site/psql.спорное отверждение
"root" directive is not allowed here in
if ($host ~* ^([a-z0-9-\.]+)\.site$) {
root /var/www/site/$1;
}
server {
server_name psql.site;
root /var/www/site/psql;
access_log /var/log/nginx/psql.site.access.log;
error_log /var/log/nginx/psql.site.error.log;
location / {
index index.php index.html;
try_files \$uri \$uri/ /index.php?\$query_string;
}
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
markdown.markdown(text)
{{text|markdown:"safe,footnotes,tables"}}
class Meta:
db_table = 'comments'
fields = ['text']
def addcomment(request, article_id):
form = CommentForm(request.POST or None )
if form.is_valid():
comment = form.save(commit=False)
comment.comments_article = Article.objects.get(id=article_id)
form.save()
# почитай reverse
return redirect('/articles/get/%s/' % article_id)
return render(request, 'template.html', {'form': form})
moderation_status = (...,
(999, 'Ревизия для показа') )
Banner:
name
text
image
moderation_status