Commit 37a5fc2c authored by Laura Morel's avatar Laura Morel
Browse files

Organize Django settings

parent f23cbd33
Angular/node_modules
Django/assets/Bos_taurus/10/
Django/assets/Bos_taurus/15/
Django/assets/Bos_taurus/20/
Django/assets/Bos_taurus/corPickle
Django/assets/Bos_taurus/metaPickle
Django/assets/Gallus_gallus/10/
Django/assets/Gallus_gallus/15/
Django/assets/Gallus_gallus/20/
Django/assets/Gallus_gallus/corPickle
Django/assets/Gallus_gallus/metaPickle
Django/assets/Ovis_aries/10/
Django/assets/Ovis_aries/15/
Django/assets/Ovis_aries/20/
Django/assets/Ovis_aries/corPickle
Django/assets/Ovis_aries/metaPickle
Django/data/heatmap/__pycache__
Django/data/management/commands/__pycache__
Django/data/migrations/__pycache__
Django/data/__pycache__
Django/db.sqlite3
Django/.env
Django/tests/test_data/__pycache__
Django/venv
Django/VizFaDa/__pycache__
Django/VizFaDa/settings/__pycache__
# Stage 0, "build-stage", based on Node.js, to build and compile the frontend
FROM node:14.13.1
WORKDIR /app
COPY Angular/package*.json /app/
RUN npm install
COPY Angular/ /app/
ARG configuration=production
RUN npm run build --configuration $configuration
......@@ -13,6 +13,7 @@ https://docs.djangoproject.com/en/3.1/ref/settings/
from pathlib import Path
import os
import corsheaders
from decouple import config
# Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve(strict=True).parent.parent
......@@ -22,12 +23,12 @@ BASE_DIR = Path(__file__).resolve(strict=True).parent.parent
# See https://docs.djangoproject.com/en/3.1/howto/deployment/checklist/
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'r3hynqwm9fvnhf7$_svv88y$#jtekrinmns9ajki6u$my@n)im'
SECRET_KEY = config('SECRET_KEY')
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
DEBUG = config('DEBUG', default=False, cast=bool)
ALLOWED_HOSTS = []
ALLOWED_HOSTS = ['http://127.0.0.1:4200']
CORS_ORIGIN_ALLOW_ALL = False
CORS_ALLOWED_ORIGINS = [
......@@ -36,14 +37,10 @@ CORS_ALLOWED_ORIGINS = [
]
CORS_ALLOW_CREDENTIALS = True
CORS_EXPOSE_HEADERS = [
'hello',
'content-type',
'set-cookie'
]
SESSION_COOKIE_HTTPONLY = False
SESSION_COOKIE_SAMESITE = "None"
# Application definition
INSTALLED_APPS = [
......@@ -55,7 +52,6 @@ INSTALLED_APPS = [
'django.contrib.messages',
'django.contrib.staticfiles',
'corsheaders',
'rest_framework.authtoken'
]
MIDDLEWARE = [
......@@ -72,8 +68,6 @@ MIDDLEWARE = [
ROOT_URLCONF = 'VizFaDa.urls'
SESSION_COOKIE_HTTPONLY = False
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
......
from .base import *
DEBUG = True
SESSION_COOKIE_HTTPONLY = False
SESSION_COOKIE_SECURE = False
SESSION_COOKIE_SAMESITE = "None"
from .base import *
DEBUG = False
SESSION_COOKIE_HTTPONLY = True
SESSION_COOKIE_SECURE = True
SESSION_COOKIE_SAMESITE = "Lax"
SECURE_SSL_REDIRECT = True
CSRF_COOKIE_SECURE = True
This diff is collapsed.
This diff is collapsed.
......@@ -2,7 +2,6 @@ import json
from django.http import HttpResponse
from django.shortcuts import get_list_or_404, get_object_or_404, render
from rest_framework.authtoken.models import Token
import matplotlib
import matplotlib.pyplot as plt
......
......@@ -6,7 +6,7 @@ import sys
def main():
"""Run administrative tasks."""
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'VizFaDa.settings')
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'VizFaDa.settings.development')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
......
......@@ -5,3 +5,5 @@ fastcluster==1.1.26
distinctipy==1.1.5
mplcairo==0.3
PyGObject==3.38
gunicorn==20.0.4
python-decouple==3.3
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