feat(api): remove admin app and static files
- remove django admin app, - disable static files for production deployment, - keep the rest framework browsable api in dev mode.
This commit is contained in:
parent
4da8d8c06b
commit
9af717ef7f
|
@ -32,7 +32,6 @@ ALLOWED_HOSTS = ["*"]
|
|||
|
||||
INSTALLED_APPS = [
|
||||
"libretime_api.apps.LibreTimeAPIConfig",
|
||||
"django.contrib.admin",
|
||||
"django.contrib.auth",
|
||||
"django.contrib.contenttypes",
|
||||
"django.contrib.sessions",
|
||||
|
@ -107,7 +106,15 @@ AUTH_PASSWORD_VALIDATORS = [
|
|||
},
|
||||
]
|
||||
|
||||
# Rest Framework settings
|
||||
# https://www.django-rest-framework.org/api-guide/settings/
|
||||
|
||||
renderer_classes = ["rest_framework.renderers.JSONRenderer"]
|
||||
if DEBUG:
|
||||
renderer_classes += ["rest_framework.renderers.BrowsableAPIRenderer"]
|
||||
|
||||
REST_FRAMEWORK = {
|
||||
"DEFAULT_RENDERER_CLASSES": renderer_classes,
|
||||
"DEFAULT_AUTHENTICATION_CLASSES": (
|
||||
"rest_framework.authentication.SessionAuthentication",
|
||||
"rest_framework.authentication.BasicAuthentication",
|
||||
|
@ -137,13 +144,6 @@ USE_L10N = True
|
|||
USE_TZ = True
|
||||
|
||||
|
||||
# Static files (CSS, JavaScript, Images)
|
||||
# https://docs.djangoproject.com/en/3.0/howto/static-files/
|
||||
|
||||
STATIC_URL = "/api/static/"
|
||||
if not DEBUG:
|
||||
STATIC_ROOT = LIBRETIME_STATIC_ROOT
|
||||
|
||||
AUTH_USER_MODEL = "libretime_api.User"
|
||||
|
||||
TEST_RUNNER = "libretime_api.tests.runners.ManagedModelTestRunner"
|
||||
|
|
1
install
1
install
|
@ -1083,7 +1083,6 @@ mkdir -p /etc/airtime
|
|||
sed -e "s@WEB_USER@${web_user}@g" \
|
||||
-e "s@WEB_ROOT@${web_root}@g" \
|
||||
"${AIRTIMEROOT}/installer/uwsgi/libretime-api.ini" > /etc/airtime/libretime-api.ini
|
||||
loudCmd "libretime-api collectstatic --clear --noinput"
|
||||
verbose "...Done"
|
||||
|
||||
verbose "\n * Setting permissions on /var/log/airtime..."
|
||||
|
|
Loading…
Reference in New Issue