Compare commits
No commits in common. "46619bd5e1e1300143a1e9e4b666dbbe69731ffc" and "4af7512293e35c6f27f90afee12325f59dd2cf7a" have entirely different histories.
46619bd5e1
...
4af7512293
7 changed files with 18 additions and 30 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
|
@ -1,4 +1,4 @@
|
|||
.env.*
|
||||
.env
|
||||
src/pkmntrade_club/staticfiles/*
|
||||
!src/pkmntrade_club/staticfiles/.gitkeep
|
||||
src/pkmntrade_club/media/*
|
||||
|
|
|
|||
8
.vscode/launch.json
vendored
8
.vscode/launch.json
vendored
|
|
@ -6,14 +6,10 @@
|
|||
"type": "debugpy",
|
||||
"request": "launch",
|
||||
"program": "${workspaceFolder}/manage.py",
|
||||
"cwd": "${workspaceFolder}",
|
||||
"args": ["runserver", "0.0.0.0:8000"],
|
||||
"args": ["runserver"],
|
||||
"django": true,
|
||||
"justMyCode": true,
|
||||
"preLaunchTask": "Run db standalone",
|
||||
"env": {
|
||||
"DEBUG": "True"
|
||||
},
|
||||
"preLaunchTask": "Run db standalone"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
@ -39,8 +39,6 @@ services:
|
|||
db:
|
||||
image: postgres:16
|
||||
restart: always
|
||||
ports:
|
||||
- 5432:5432
|
||||
volumes:
|
||||
- postgres_data:/var/lib/postgresql/data/
|
||||
environment:
|
||||
|
|
|
|||
|
|
@ -6,8 +6,6 @@ import sys
|
|||
def main():
|
||||
"""Run administrative tasks."""
|
||||
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "pkmntrade_club.django_project.settings")
|
||||
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
||||
|
||||
try:
|
||||
from django.core.management import execute_from_command_line
|
||||
except ImportError as exc:
|
||||
|
|
|
|||
|
|
@ -4,23 +4,22 @@ set -e
|
|||
|
||||
echo "Remaking migrations..."
|
||||
find . -path "*/migrations/0*.py" -delete
|
||||
set -a
|
||||
source .env
|
||||
set +a
|
||||
uv run manage.py makemigrations --noinput
|
||||
|
||||
echo "Resetting dev database... "
|
||||
docker compose down \
|
||||
&& docker volume rm -f pkmntradeclub_postgres_data \
|
||||
&& docker compose up -d db
|
||||
|
||||
echo "Running prebuild..."
|
||||
./scripts/prebuild.sh
|
||||
|
||||
echo "Running migrations..."
|
||||
uv run manage.py migrate --noinput
|
||||
&& ./scripts/rebuild-and-run.sh
|
||||
|
||||
# Wait for the database to be ready.
|
||||
echo "Waiting 15 seconds for migrations to be auto-run..."
|
||||
sleep 15
|
||||
echo "Loading seed data..."
|
||||
uv run manage.py loaddata ./seed/0*
|
||||
docker compose exec -it web bash -c "django-admin loaddata /seed/0*"
|
||||
|
||||
echo "Running collectstatic..."
|
||||
uv run manage.py collectstatic -c --no-input
|
||||
docker compose down
|
||||
|
||||
echo "Done!"
|
||||
|
|
|
|||
|
|
@ -5,12 +5,12 @@ import os
|
|||
import logging
|
||||
import sys
|
||||
|
||||
# set default values to local dev values
|
||||
# set default values to dev values for environment variables
|
||||
env = environ.Env(
|
||||
DEBUG=(bool, False), # MUST STAY FALSE FOR DEFAULT FOR SECURITY REASONS (e.g. if app can't access .env, prevent showing debug output)
|
||||
DISABLE_SIGNUPS=(bool, True),
|
||||
DISABLE_CACHE=(bool, True),
|
||||
DJANGO_DATABASE_URL=(str, 'postgresql://postgres@localhost:5432/postgres?sslmode=disable'),
|
||||
DISABLE_SIGNUPS=(bool, False),
|
||||
DISABLE_CACHE=(bool, False),
|
||||
DJANGO_DATABASE_URL=(str, 'postgresql://postgres@db:5432/postgres?sslmode=disable'),
|
||||
DJANGO_EMAIL_HOST=(str, ''),
|
||||
DJANGO_EMAIL_PORT=(int, 587),
|
||||
DJANGO_EMAIL_USER=(str, ''),
|
||||
|
|
@ -22,7 +22,7 @@ env = environ.Env(
|
|||
PUBLIC_HOST=(str, 'localhost'),
|
||||
ACCOUNT_EMAIL_VERIFICATION=(str, 'none'),
|
||||
SCHEME=(str, 'http'),
|
||||
REDIS_URL=(str, 'redis://localhost:6379'),
|
||||
REDIS_URL=(str, 'redis://redis:6379'),
|
||||
CACHE_TIMEOUT=(int, 604800),
|
||||
TIME_ZONE=(str, 'America/Los_Angeles'),
|
||||
)
|
||||
|
|
@ -366,9 +366,6 @@ SOCIALACCOUNT_EMAIL_AUTHENTICATION = False
|
|||
SOCIALACCOUNT_EMAIL_AUTHENTICATION_AUTO_CONNECT = False
|
||||
SOCIALACCOUNT_ONLY = False
|
||||
|
||||
SESSION_ENGINE = "django.contrib.sessions.backends.signed_cookies"
|
||||
SESSION_COOKIE_HTTPONLY = True
|
||||
|
||||
# auto-detection doesn't work properly sometimes, so we'll just use the DEBUG setting
|
||||
DEBUG_TOOLBAR_CONFIG = {"SHOW_TOOLBAR_CALLBACK": lambda request: DEBUG}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
{% load gravatar card_badge cache %}
|
||||
{% load gravatar card_badge %}
|
||||
|
||||
{% cache CACHE_TIMEOUT trade_acceptance cache_key %}
|
||||
<div class="card card-border bg-base-100 shadow-lg max-w-90 mx-auto">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue