Skip to content

Commit

Permalink
fix: docker contain settings and django settings for dev and prod (#124)
Browse files Browse the repository at this point in the history
  • Loading branch information
wax911 authored Apr 29, 2024
1 parent 789a67b commit 489818c
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 10 deletions.
2 changes: 0 additions & 2 deletions app/settings/development.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,11 @@
EMAIL_BACKEND = "django.core.mail.backends.console.EmailBackend"

# Media (Images, Backgrounds and more)

MEDIA_URL = "/media/"
MEDIA_ROOT = os.path.join(BASE_DIR, "media-content")

# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/3.2/howto/static-files/

STATIC_URL = "/static/"
STATIC_ROOT = os.path.join(BASE_DIR, "static")

Expand Down
2 changes: 0 additions & 2 deletions app/settings/production.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,8 @@

from .common import *

SECURE_SSL_REDIRECT = True
SESSION_COOKIE_SECURE = True
CSRF_COOKIE_SECURE = True
SECURE_BROWSER_XSS_FILTER = True

CACHES = {
"default": {
Expand Down
4 changes: 2 additions & 2 deletions app/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ def build_url_patterns() -> List[RoutePattern]:
path("", include('web.urls')),
path('admin/', admin.site.urls),
path("graphql/", csrf_exempt(GraphQLView.as_view(graphiql=False))),
path("playground/", csrf_exempt(GraphQLPlaygroundView.as_view(endpoint="http://localhost:8000/graphql/"))),
path("playground/", csrf_exempt(GraphQLPlaygroundView.as_view(endpoint="/graphql/"))),
] + static_routes
return [
path("", include('web.urls')),
path("graphql/", csrf_exempt(GraphQLView.as_view(graphiql=True))),
path("graphql/", csrf_exempt(GraphQLView.as_view(graphiql=False))),
]


Expand Down
11 changes: 7 additions & 4 deletions start.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
#!/usr/bin/env bash

echo "Starting migrations"
python manage.py makemigrations migrate
echo "Checking and starting migrations"
python manage.py makemigrations
python manage.py migrate

echo 'Collecting static files...'
python manage.py collectstatic --no-input
if [ "$1" = "--debug" ]; then
echo 'Collecting static files...'
python manage.py collectstatic --no-input
fi

echo "Starting qcluster"
python manage.py qcluster &
Expand Down

0 comments on commit 489818c

Please sign in to comment.