Skip to content

Commit

Permalink
Added css to django admin
Browse files Browse the repository at this point in the history
  • Loading branch information
vincue committed Aug 17, 2021
1 parent 1e271d3 commit d21b34a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
5 changes: 3 additions & 2 deletions api/app/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"django.contrib.staticfiles",
"corsheaders",
"allauth",
'django.contrib.sites',
"django.contrib.sites",
"allauth.account",
"allauth.socialaccount",
"allauth.socialaccount.providers.google",
Expand Down Expand Up @@ -76,7 +76,7 @@
"allauth.account.auth_backends.AuthenticationBackend",
)

AUTHENTICATION_REQUIRED=os.environ.get("IS_AUTHENTICATION_REQUIRED", False)
AUTHENTICATION_REQUIRED = os.environ.get("IS_AUTHENTICATION_REQUIRED", False)
ACCOUNT_AUTHENTICATION_METHOD = "email"
ACCOUNT_EMAIL_REQUIRED = True
ACCOUNT_UNIQUE_EMAIL = True
Expand Down Expand Up @@ -162,6 +162,7 @@
# https://docs.djangoproject.com/en/3.2/howto/static-files/

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

# Default primary key field type
# https://docs.djangoproject.com/en/3.2/ref/settings/#default-auto-field
Expand Down
1 change: 1 addition & 0 deletions api/start_server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ if [ -n "$DJANGO_SUPERUSER_USERNAME" ] && [ -n "$DJANGO_SUPERUSER_EMAIL" ] && [
fi
chmod -R 777 db
chown -R www-data:www-data db
python ./manage.py collectstatic
(gunicorn app.wsgi --user www-data --bind 0.0.0.0:8000 --workers 3 --timeout 300) &
(celery -A app worker --concurrency=6 -l INFO --purge) &
(celery -A app beat -l INFO --scheduler django_celery_beat.schedulers:DatabaseScheduler) &
Expand Down
6 changes: 6 additions & 0 deletions nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ server {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}

location /static {
proxy_pass http://127.0.0.1:8000;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}

location / {
root /usr/share/nginx/html;
index index.html index.htm;
Expand Down

0 comments on commit d21b34a

Please sign in to comment.