Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ description = "Add your description here"
readme = "README.md"
requires-python = ">=3.13"
dependencies = [
"django-cors-headers>=4.7.0",
"django-rest-framework>=0.1.0",
"django>=5.1.7",
"drf-spectacular>=0.28.0",
Expand Down
11 changes: 8 additions & 3 deletions src/ledger/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,15 @@
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = bool(os.environ.get("DJANGO_DEBUG", default="1"))

ALLOWED_HOSTS = ["*"]
ALLOWED_HOSTS = ["*"] if DEBUG else ["ledger.unitystation.org"]

# CSRF
CSRF_TRUSTED_ORIGINS = ['https://ledger.unitystation.org']
CORS_ORIGIN_ALLOW_ALL = DEBUG
CORS_ALLOWED_ORIGINS = ['https://ledger.unitystation.org']

# CORS
CORS_ALLOW_ALL_ORIGINS = True
CORS_ALLOW_METHODS = ["GET", "HEAD", "OPTIONS"]

SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')

# Application definition
Expand All @@ -44,13 +47,15 @@
'django.contrib.messages',
'whitenoise.runserver_nostatic',
'django.contrib.staticfiles',
'corsheaders',
'rest_framework',
'transactions',
'drf_spectacular'
]

MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'corsheaders.middleware.CorsMiddleware',
'whitenoise.middleware.WhiteNoiseMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
Expand Down
15 changes: 15 additions & 0 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading