-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Updated build env * Updated build env * Added static and media storage classes (#289) * Added static and media storage classes * Removed unused default * Use -T for exec * Fixed github actions * Bump django from 3.2.7 to 3.2.8 (#295) Bumps [django](https://github.com/django/django) from 3.2.7 to 3.2.8. - [Release notes](https://github.com/django/django/releases) - [Commits](django/django@3.2.7...3.2.8) --- updated-dependencies: - dependency-name: django dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump xlsxwriter from 1.4.5 to 3.0.1 (#290) Bumps [xlsxwriter](https://github.com/jmcnamara/XlsxWriter) from 1.4.5 to 3.0.1. - [Release notes](https://github.com/jmcnamara/XlsxWriter/releases) - [Changelog](https://github.com/jmcnamara/XlsxWriter/blob/main/Changes) - [Commits](jmcnamara/XlsxWriter@RELEASE_1.4.5...RELEASE_3.0.1) --- updated-dependencies: - dependency-name: xlsxwriter dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump pytz from 2021.1 to 2021.3 (#291) Bumps [pytz](https://github.com/stub42/pytz) from 2021.1 to 2021.3. - [Release notes](https://github.com/stub42/pytz/releases) - [Commits](stub42/pytz@release_2021.1...release_2021.3) --- updated-dependencies: - dependency-name: pytz dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump faker from 8.14.1 to 8.16.0 (#292) Bumps [faker](https://github.com/joke2k/faker) from 8.14.1 to 8.16.0. - [Release notes](https://github.com/joke2k/faker/releases) - [Changelog](https://github.com/joke2k/faker/blob/master/CHANGELOG.md) - [Commits](joke2k/faker@v8.14.1...v8.16.0) --- updated-dependencies: - dependency-name: faker dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump django-cors-headers from 3.9.0 to 3.10.0 (#294) Bumps [django-cors-headers](https://github.com/adamchainz/django-cors-headers) from 3.9.0 to 3.10.0. - [Release notes](https://github.com/adamchainz/django-cors-headers/releases) - [Changelog](https://github.com/adamchainz/django-cors-headers/blob/main/HISTORY.rst) - [Commits](adamchainz/django-cors-headers@3.9.0...3.10.0) --- updated-dependencies: - dependency-name: django-cors-headers dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Added static dir to static files * Updated static config * Update static config * Added extra permission checks (#296) * Added extra permission checks * Nasty hack to fix tests * Bump faker from 8.16.0 to 9.0.0 (#297) Bumps [faker](https://github.com/joke2k/faker) from 8.16.0 to 9.0.0. - [Release notes](https://github.com/joke2k/faker/releases) - [Changelog](https://github.com/joke2k/faker/blob/master/CHANGELOG.md) - [Commits](joke2k/faker@v8.16.0...v9.0.0) --- updated-dependencies: - dependency-name: faker dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Ignore order of search results * Build dev container on push to dev * fix: Update booking target user (#298) * update total to a property, and "fix" slow load times on booking index in admin * check for draft booking when changing target user * Update test_mutations.py * Update test_mutations.py * repo: Fix Single Seed & Implement .env (#300) * Fix single seed e2e command * Allow for a .env file in root * Update local.yml * Fix lint thing * Appease the man * Dont include .env in docker images Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Alex Toff <[email protected]>
- Loading branch information
1 parent
fecf5f5
commit b05ab77
Showing
35 changed files
with
316 additions
and
122 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,2 @@ | ||
.* | ||
!.coveragerc | ||
!.env |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Use this file to add environment variables into the image environment | ||
# Rename it to ".env" and it should be automatically read | ||
|
||
# Square | ||
SQUARE_ACCESS_TOKEN= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -55,6 +55,7 @@ coverage.xml | |
.static_storage/ | ||
.media/ | ||
local_settings.py | ||
staticfiles/ | ||
|
||
# Flask stuff: | ||
instance/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,8 +8,12 @@ | |
|
||
env = environ.Env() | ||
|
||
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) | ||
BASE_URL = os.getenv( | ||
BASE_DIR = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) | ||
|
||
# Take environment variables from .env file | ||
environ.Env.read_env(os.path.join(BASE_DIR, ".env")) | ||
|
||
BASE_URL = env( | ||
"BASE_URL", | ||
default="http://localhost:8000", | ||
) | ||
|
@@ -65,41 +69,38 @@ | |
|
||
ALLOWED_HOSTS = ["*"] | ||
ROOT_URLCONF = "uobtheatre.urls" | ||
SECRET_KEY = os.getenv( | ||
SECRET_KEY = env( | ||
"DJANGO_SECRET_KEY", | ||
default="Ha57AUXmBdFS48TKYPMhauspK7BhwpveyvM9PGsCwwcT7RfwUN2rVkYnbuXkWhcU", | ||
) | ||
WSGI_APPLICATION = "config.wsgi.application" | ||
|
||
EMAIL_BACKEND = "django.core.mail.backends.smtp.EmailBackend" | ||
EMAIL_HOST = os.getenv("EMAIL_HOST", "localhost") | ||
EMAIL_PORT = os.getenv("EMAIL_PORT") or 1025 | ||
EMAIL_HOST_USER = os.getenv("EMAIL_HOST_USER") | ||
EMAIL_HOST_PASSWORD = os.getenv("EMAIL_HOST_PASSWORD") | ||
EMAIL_HOST = env("EMAIL_HOST", default="localhost") | ||
EMAIL_PORT = env("EMAIL_PORT", default=1025) | ||
EMAIL_HOST_USER = env("EMAIL_HOST_USER", default=None) | ||
EMAIL_HOST_PASSWORD = env("EMAIL_HOST_PASSWORD", default=None) | ||
DEFAULT_FROM_EMAIL = "UOB Theatre <[email protected]>" | ||
|
||
ADMINS = (("Author", "[email protected]"),) | ||
|
||
|
||
# Postgres | ||
DATABASES = { | ||
"default": env.db( | ||
"DATABASE_URL", "postgresql://postgres:postgres@postgres:5432/uobtheatre_api" | ||
) | ||
} | ||
if env("DATABASE_URL", default=None): # ignore: | ||
DATABASES = {"default": env.db("DATABASE_URL", default="")} | ||
else: | ||
DATABASES = { | ||
"default": { | ||
"ENGINE": "django.db.backends.postgresql_psycopg2", | ||
"NAME": env("POSTGRES_DB", default="postgres"), | ||
"USER": env("POSTGRES_USER", default="postgres"), | ||
"PASSWORD": env("POSTGRES_PASSWORD", default="postgres"), | ||
"HOST": env("POSTGRES_HOST", default="postgres"), | ||
"PORT": env("POSTGRES_PORT", default="5432"), | ||
} | ||
} | ||
DATABASES["default"]["ATOMIC_REQUESTS"] = True | ||
# DATABASES = { | ||
# "default" | ||
# "default": { | ||
# "ENGINE": "django.db.backends.postgresql_psycopg2", | ||
# "NAME": os.getenv("DATABASE_NAME", default="postgres"), | ||
# "USER": os.getenv("DATABASE_USER", default="postgres"), | ||
# "PASSWORD": os.getenv("DATABASE_PASSWORD", default="postgres"), | ||
# "HOST": os.getenv("DATABASE_HOST", default="postgres"), | ||
# "PORT": os.getenv("DATABASE_PORT", default=5432), | ||
# } | ||
# } | ||
|
||
# General | ||
APPEND_SLASH = False | ||
|
@@ -114,8 +115,10 @@ | |
|
||
# Static files (CSS, JavaScript, Images) | ||
# https://docs.djangoproject.com/en/2.0/howto/static-files/ | ||
STATIC_ROOT = os.path.normpath(join(os.path.dirname(BASE_DIR), "static")) | ||
STATICFILES_DIRS: List[str] = [] | ||
STATIC_ROOT = os.path.normpath(join(os.path.dirname(BASE_DIR), "staticfiles")) | ||
STATICFILES_DIRS: List[str] = [ | ||
os.path.normpath(join(os.path.dirname(BASE_DIR), "static")) | ||
] | ||
STATIC_URL = "/static/" | ||
STATICFILES_FINDERS = ( | ||
"django.contrib.staticfiles.finders.FileSystemFinder", | ||
|
@@ -144,7 +147,7 @@ | |
|
||
# Set DEBUG to False as a default for safety | ||
# https://docs.djangoproject.com/en/dev/ref/settings/#debug | ||
DEBUG = strtobool(os.getenv("DJANGO_DEBUG", "no")) | ||
DEBUG = strtobool(env("DJANGO_DEBUG", default="no")) | ||
|
||
# Password Validation | ||
# https://docs.djangoproject.com/en/2.0/topics/auth/passwords/#module-django.contrib.auth.password_validation | ||
|
@@ -293,24 +296,25 @@ | |
"SCHEMA": "uobtheatre.schema.schema", | ||
"MIDDLEWARE": [ | ||
"graphql_jwt.middleware.JSONWebTokenMiddleware", | ||
"uobtheatre.utils.exceptions.ExceptionMiddleware", | ||
], | ||
} | ||
|
||
# Square payments | ||
SQUARE_SETTINGS = { | ||
"SQUARE_ACCESS_TOKEN": os.getenv( | ||
"SQUARE_ACCESS_TOKEN": env( | ||
"SQUARE_ACCESS_TOKEN", | ||
default="", | ||
), | ||
"SQUARE_ENVIRONMENT": os.getenv( | ||
"SQUARE_ENVIRONMENT": env( | ||
"SQUARE_ENVIRONMENT", | ||
default="sandbox", | ||
), | ||
"SQUARE_LOCATION": os.getenv( | ||
"SQUARE_LOCATION": env( | ||
"SQUARE_LOCATION", | ||
default="", | ||
), | ||
"SQUARE_WEBHOOK_SIGNATURE_KEY": os.getenv( | ||
"SQUARE_WEBHOOK_SIGNATURE_KEY": env( | ||
"SQUARE_WEBHOOK_SIGNATURE_KEY", | ||
default="", | ||
), | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.