sudo apt-get install libjpeg8 libjpeg-dev \
libfreetype6 libfreetype6-dev zlib1g-dev \
libwebp-dev libwebp5
.....
(myvirtualenv) $ pip install pillow
python -c "import PIL"
ADMINS = (('Your nam.', 'mailfor_error@gmail.com'),)
...
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST = 'smtp.yandex.ru' # or google
EMAIL_HOST_PASSWORD = 'password'
EMAIL_HOST_USER = 'login'
DEFAULT_FROM_EMAIL = EMAIL_HOST_USER
SERVER_EMAIL = DEFAULT_FROM_EMAIL
EMAIL_PORT = 465
EMAIL_USE_SSL = True
...
LOGGING = {
'version': 1,
'disable_existing_loggers': True,
'formatters': {
'verbose': {
'format': '%(levelname)s %(asctime)s %(module)s '
'%(process)d %(thread)d %(message)s'
},
'simple': {
'format': '%(levelname)s %(message)s'
},
},
'handlers': {
'null': {
'level': 'DEBUG',
'class': 'django.utils.log.NullHandler',
},
'console': {
'level': 'DEBUG',
'class': 'logging.StreamHandler',
'formatter': 'simple'
},
'mail_admins': {
'level': 'ERROR',
'class': 'django.utils.log.AdminEmailHandler',
'include_html': True,
}
},
'loggers': {
'django': {
'handlers': ['console'],
'propagate': True,
'level': 'INFO',
},
'django.db': {
'level': 'DEBUG',
'handlers': ['console'],
'propagate': True,
},
'django.request': {
'handlers': ['mail_admins', 'console'],
'level': 'ERROR',
'propagate': False,
},
}
}
var xhr = new XMLHttpRequest();
xhr.open("POST", '/some-url', true)
xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
xhr.send("param_name=param_val");
def simple_ajax(request):
if request.method == 'POST':
print(request.POST.get('param_name'))
<div style="float:left;width:400px;height:400px"> </div>
<div style="float:left;width:200px;height:200px"> </div>
<div style="float:left;width:200px;height:200px"> </div>
<div style="float:left;width:200px;height:200px"> </div>
<div style="float:left;width:200px;height:200px"> </div>
<div style="float:left;width:200px;height:200px"> </div>
<div style="float:left;width:200px;height:200px"> </div>
<br style="clear:both;/>
mir-ezo.ru
www.vmagie.com
tonkiimir.ru