Open the postgresql.conf config file:
$> mate /usr/local/var/postgres/postgresql.conf
Uncomment the line with 'log_destination' and set it to 'syslog'
log_destination = 'syslog'
Open the syslog config:
Open the postgresql.conf config file:
$> mate /usr/local/var/postgres/postgresql.conf
Uncomment the line with 'log_destination' and set it to 'syslog'
log_destination = 'syslog'
Open the syslog config:
#!/usr/bin/python | |
venv = '/PATH_TO_ENVIRONMENT/bin/activate_this.py' | |
execfile(venv, dict(__file__=venv)) | |
import locale | |
locale.setlocale(locale.LC_ALL, 'ru_RU.utf8') | |
import sys | |
import os |
AddHandler wsgi-script .wsgi | |
RewriteEngine on | |
RewriteBase / | |
RewriteRule ^(media/.*)$ - [L] | |
RewriteRule ^(static/.*)$ - [L] | |
RewriteCond %{REQUEST_URI} !(django.wsgi) | |
RewriteRule ^(.*)$ django.wsgi/$1 [L] |
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# | |
# Video of original screencast: https://vimeo.com/57296525 | |
# | |
# Modified by Vladimir Garvardt | |
# | |
from __future__ import print_function | |
import os |
Схема работы в данном случае такая:
#!/usr/bin/env python | |
import os | |
import argparse | |
import sqlite3 | |
import logging | |
try: | |
# tornado is bundled with pretty formatter - try using it | |
from tornado.options import enable_pretty_logging | |
enable_pretty_logging() |
import logging | |
from tornado.options import enable_pretty_logging | |
enable_pretty_logging() | |
logger = logging.getLogger() | |
logger.setLevel(logging.DEBUG) |
# -*- coding:utf-8 -*- | |
import os | |
import functools | |
import pprint | |
import base64 | |
import json | |
from datetime import datetime | |
from tornado import gen |