Skip to content
Snippets Groups Projects

Fix Secfit

Merged Olav Håberg Dimmen requested to merge fix/secfit into master
1 file
+ 9
11
Compare changes
  • Side-by-side
  • Inline
@@ -12,21 +12,24 @@ https://docs.djangoproject.com/en/3.1/ref/settings/
from pathlib import Path
import os
from typing import Dict
import dj_database_url
import dotenv
# Get the GROUPID variable to accept connections from the application server and NGINX
groupid = os.environ.get("GROUPID", "0")
group_id = os.environ.get("GROUPID", "0")
# Email configuration
# The host must be running within NTNU's VPN (vpn.ntnu.no) to allow this config
# Usage: https://docs.djangoproject.com/en/3.1/topics/email/#obtaining-an-instance-of-an-email-backend
# Usage:
# https://docs.djangoproject.com/en/3.1/topics/email/#obtaining-an-instance-of-an-email-backend
EMAIL_BACKEND = "django.core.mail.backends.smtp.EmailBackend"
EMAIL_HOST = "mx.ntnu.no"
EMAIL_USE_TLS = False
EMAIL_PORT = 25
# Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve(strict=True).parent.parent
dotenv_file = os.path.join(BASE_DIR, ".env")
@@ -42,8 +45,8 @@ ALLOWED_HOSTS = [
"127.0.0.1",
"localhost",
"0.0.0.0",
"10." + groupid + ".0.6",
"10." + groupid + ".0.4",
"10." + group_id + ".0.6",
"10." + group_id + ".0.4",
"molde.idi.ntnu.no",
"10.0.2.2",
"tdt4242-t11.herokuapp.com",
@@ -96,12 +99,11 @@ TEMPLATES = [
WSGI_APPLICATION = "secfit.wsgi.application"
# Database
# https://docs.djangoproject.com/en/3.1/ref/settings/#databases
if 'DATABASE_URL' in os.environ:
DATABASES = {
DATABASES: Dict[str, Dict] = {
"default": {}
}
db_from_env = dj_database_url.config(conn_max_age=500)
@@ -114,8 +116,6 @@ else:
}
}
# CORS Policy
CORS_ORIGIN_ALLOW_ALL = (
True
@@ -134,7 +134,6 @@ USE_L10N = True
USE_TZ = True
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/3.1/howto/static-files/
@@ -146,7 +145,6 @@ STATIC_URL = "/static/"
MEDIA_ROOT = os.path.join(BASE_DIR, "media")
MEDIA_URL = "/media/"
REST_FRAMEWORK = {
"DEFAULT_PAGINATION_CLASS": "rest_framework.pagination.PageNumberPagination",
"PAGE_SIZE": 10,
Loading