Files
octopus/ГИД ПО ЗАПУСКУ
2025-12-31 01:34:12 +03:00

39 lines
1.0 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
docker run -d `
--name postgres17 `
-e POSTGRES_PASSWORD=postgres `
-e POSTGRES_USER=postgres `
-e POSTGRES_DB=inventory_db `
-p 5432:5432 `
-v postgres17-data:/var/lib/postgresql/data `
postgres:17
# 2. Создаем миграции с нуля
python manage.py makemigrations
# 3. Применяем все миграции
python manage.py migrate
# 4. Создаем главного тенанта (если нужно)
python manage.py shell
# Внутри shell:
from tenants.models import Client, Domain
client = Client.objects.create(
name='Main',
schema_name='public'
)
Domain.objects.create(
domain='localhost',
tenant=client,
is_primary=True
)
# Добавляем 127.0.0.1 как синоним localhost (иначе админка по 127.0.0.1 не будет работать)
Domain.objects.create(
domain='127.0.0.1',
tenant=client,
is_primary=False
)
exit()
# 5. Создаем суперпользователя для public схемы
python manage.py createsuperuser