Commit 1028b24e authored by Laura Morel's avatar Laura Morel
Browse files

Generate random secret key for Django backend

parent 4b779ced
......@@ -11,6 +11,7 @@ WORKDIR /code
COPY . /code/
RUN python3.8 generate_secret_key
RUN python3.8 makemigrations
RUN python3.8 migrate --run-syncdb && python fill_db True
from import BaseCommand, CommandError
from import get_random_secret_key
class Command(BaseCommand):
def generate_secret_key(self):
with open(".env", "w") as f:
f.write("SECRET_KEY='%s'\n" %(key))
def handle(self, **options):
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment