Шпаргалка с командами Docker
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="cart"> | |
{% with total_items=cart|length %} | |
{% if cart|length > 0 %} | |
Ваша корзина: | |
<a href="{% url "cart:CartDetail" %}"> | |
{{ total_items }} тов. {{ cart.get_total_price }} руб. | |
</a> | |
{% else %} | |
Корзина пустая | |
{% endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Полезные ключи программы psql | |
-U - Указываем пользователя, например postgres | |
-W - Приглашение на ввод пароля | |
-d название_БД - Подключение к БД название_БД | |
-h имя_хоста - Подключение к хосту имя_хоста | |
-p порт - По какому порту постгря ожидает подключения | |
-c команда - Выполнение команды SQL без выхода в интерактивный режим | |
-f file.sql - Выполнение команд из файла file.sql | |
-S - Однострочный режим, то есть, переход на новую строку будет выполнять запрос (избавляет от ; в конце конструкции SQL) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
This is a simple example of usage of CallbackData factory | |
For more comprehensive example see callback_data_factory.py | |
""" | |
import asyncio | |
import logging | |
from aiogram import Bot, Dispatcher, executor, types | |
from aiogram.contrib.fsm_storage.memory import MemoryStorage |
Deploy Django and React APP in a production VPS (Django + React + PostgreSQL + NGINX + Ubuntu Server)
Assuming You have backend and frontend codes in /home/backend
and /home/frontend/
(Use git to upload)
sudo apt-get update
sudo apt-get install python3-pip python3-dev libpq-dev postgresql postgresql-contrib nginx