from uuid import UUID
class Book(models.Model):
section = models.ForeignKey(Section, related_name="books")
{{ sec.books.count }}
{% load staticfiles %}
<img src="{% static "my_app/myexample.jpg" %}" alt="My image"/>{{ mymodel.my_image_field.url }}
#### server
балансер(прокси) | {твой контейнер: nginx -> [static_files, dynamic_django]
| {другой контейнер: nginx -> [static_files, dynamic]
....
#### server/usr/local/bin/python
Shop
name
Product:
name
StockUnit
name
size
StockUnitInShop
sku
count_in_shop
product = FK(Product)
shop = FK(Shop)
{{ model_name.pdf_field_name.url }}
cpu-affinityOne word: why? Many people think that CPU pinning is a good thing. It rarely if ever provides any performance increase over just letting the kernel's CPU scheduler do its thing
processes = 1
threads = 1
class Category(models.Model):
name =....
class Product(models.Model):
category = models.ForeignKey(Category)
title = models.TextField(verbose_name='Номер',blank=True)
producte = models.TextField(verbose_name='Продукт')
class Order(models.Model):
products = models.ManyToMany(Product)