Skip to content

Commit

Permalink
configure settings and add .env file
Browse files Browse the repository at this point in the history
  • Loading branch information
Postpostman committed Dec 6, 2024
1 parent 3210c41 commit 6261a64
Show file tree
Hide file tree
Showing 3 changed files with 86 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
# Generated by Django 4.1 on 2024-12-06 13:08

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
("cinema", "0001_initial"),
]

operations = [
migrations.CreateModel(
name="Actor",
fields=[
(
"id",
models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
("first_name", models.CharField(max_length=63)),
("last_name", models.CharField(max_length=63)),
],
),
migrations.CreateModel(
name="CinemaHall",
fields=[
(
"id",
models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
("name", models.CharField(max_length=63)),
("rows", models.IntegerField()),
("seats_in_row", models.IntegerField()),
],
),
migrations.CreateModel(
name="Genre",
fields=[
(
"id",
models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
("name", models.CharField(max_length=63, unique=True)),
],
),
migrations.AlterField(
model_name="movie",
name="description",
field=models.CharField(max_length=255, null=True),
),
migrations.AlterField(
model_name="movie",
name="title",
field=models.CharField(max_length=63),
),
migrations.AddField(
model_name="movie",
name="actors",
field=models.ManyToManyField(related_name="movies", to="cinema.actor"),
),
migrations.AddField(
model_name="movie",
name="genres",
field=models.ManyToManyField(related_name="movies", to="cinema.genre"),
),
]
10 changes: 4 additions & 6 deletions cinema_service/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
For the full list of settings and their values, see
https://docs.djangoproject.com/en/4.0/ref/settings/
"""

import os
from pathlib import Path

# Build paths inside the project like this: BASE_DIR / 'subdir'.
Expand All @@ -20,14 +20,12 @@
# See https://docs.djangoproject.com/en/4.0/howto/deployment/checklist/

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = (
"django-insecure-ru6ndfka@95_(lysua8yhdjq@vpiqgv3yru4r)q3h4_u8x7dfy"
)

SECRET_KEY = os.getenv("DJANGO_SECRET_KEY")
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
DEBUG = False

ALLOWED_HOSTS = []
ALLOWED_HOSTS = ['127.0.0.1', 'localhost']


# Application definition
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ flake8-quotes==3.3.1
flake8-variables-names==0.0.5
pep8-naming==0.13.2
django-debug-toolbar==3.2.4
djangorestframework==3.13.1
djangorestframework==3.13.1

0 comments on commit 6261a64

Please sign in to comment.