diff --git a/compose/prod/Dockerfile b/compose/prod/Dockerfile index 74532df..2b5509f 100644 --- a/compose/prod/Dockerfile +++ b/compose/prod/Dockerfile @@ -37,6 +37,7 @@ RUN pip install --no-cache-dir -r prod.txt COPY manage.py manage.py COPY config config COPY apps apps +COPY data data COPY --from=node /app/build ./build diff --git a/compose/prod/start b/compose/prod/start index 9ab4b83..6f2437d 100644 --- a/compose/prod/start +++ b/compose/prod/start @@ -6,5 +6,6 @@ set -o nounset python manage.py makemigrations python manage.py migrate +python manage.py loaddata data/site/users.json python manage.py collectstatic --noinput exec /usr/local/bin/daphne -b 0.0.0.0 -p 8000 config.asgi:application diff --git a/config/settings.py b/config/settings.py index 10d31f6..1e0a0a8 100644 --- a/config/settings.py +++ b/config/settings.py @@ -170,5 +170,8 @@ if origins:=os.getenv('DJANGO_CORS_ALLOWED_ORIGINS'): CORS_ALLOWED_ORIGINS = origins.split(',') CORS_ALLOW_CREDENTIALS = True +if trusted_origins:=os.getenv('DJANGO_CSRF_TRUSTED_ORIGINS'): + CSRF_TRUSTED_ORIGINS = [origin.strip() for origin in trusted_origins.split(',')] + if DEBUG: SECURE_CROSS_ORIGIN_OPENER_POLICY = None diff --git a/data/site/users.json b/data/site/users.json new file mode 100644 index 0000000..854def4 --- /dev/null +++ b/data/site/users.json @@ -0,0 +1,26 @@ +[ +{ + "model": "users.user", + "pk": 1, + "fields": { + "password": "pbkdf2_sha256$1000000$3z9wkVXkAJggKwrXvhUJJc$swijjGwX6JsYjRvuNECvPxqG8BqMydUjaz1FemMWVL8=", + "last_login": null, + "is_superuser": false, + "created_at": "2025-12-18T23:51:25.301Z", + "updated_at": "2025-12-18T23:51:25.301Z", + "uuid": "5cbef8ca-a24d-4f88-b403-0d53f6a239e6", + "email_address": "a@gmail.com", + "first_name": "a", + "last_name": "a", + "date_of_birth": "2001-01-01", + "bio": "", + "timezone": "UTC", + "avatar_url": "", + "is_active": true, + "is_staff": true, + "role": "employee", + "groups": [], + "user_permissions": [] + } +} +]