TICKET_STATUS_OPEN = 1
TICKET_STATUS_CLOSE = 2
TICKET_STATUS_DEPRECATED = 3
TICKET_STATUS_TRASH = 4
TICKET_STATUSES = (
(TICKET_STATUS_OPEN, 'OPEN'),
(TICKET_STATUS_CLOSE, 'CLOSE'),
(TICKET_STATUS_DEPRECATED, 'DEPRECATED'),
(TICKET_STATUS_TRASH, 'TRASH'),
)
title = models.CharField(max_length=100)
status = models.PositiveIntegerField(max_length=2, choices=TICKET_STATUSES, default=TICKET_STATUS_OPEN)
send_mail(subject, message, phone, ['myemail@mail.ru'], recepients)
send_mail(subject, message, from_email, recipient_list, fail_silently=False, auth_user=None, auth_password=None, connection=None, html_message=None)
user = models.OneToOneField(User)count = models.ManyToManyField(Article) название поля не отвечает содержимому
sudo apt-get install postgresql-server-dev-9.3 python3-devlibpq-dev
Description: header files for libpq5 (PostgreSQL library)
Header files and static library for compiling C programs to link with the libpq library in
order to communicate with a PostgreSQL database backend.
sudo apt-get install libpq-dev python3-dev
разнести настройки "по категориям"Никогда такой надобности не было
foo='bar'from settings1.py import *зависимости от environment, например, db.py разный для prod\dev\test
myprog
├── manage.py
└── myprog
├── __init__.py
├── settings
│ ├── __init__.py
│ ├── global.py
│ └── settings_test.py
├── urls.py
└── wsgi.pyimport os
if os.environ['test']:
from settings_test.py import *# common settings for all env typesfrom global.py import *
foo='buzz'
{% load static %}
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>{{ page_title }}</title>
<link rel="stylesheet" href="{% static "css/main.css" %}">
<link rel="shortcut icon" type="image/png" href="{% static "favicon.ico" %}">
....