WIP
This commit is contained in:
@ -63,7 +63,7 @@ DISCORD_WEBHOOK_URL: str = os.getenv(key="DISCORD_WEBHOOK_URL", default="")
|
||||
|
||||
INSTALLED_APPS: list[str] = [
|
||||
"core.apps.CoreConfig",
|
||||
"twitch.apps.TwitchConfig",
|
||||
"twitch_app.apps.TwitchConfig",
|
||||
"whitenoise.runserver_nostatic",
|
||||
"django.contrib.admin",
|
||||
"django.contrib.auth",
|
||||
@ -72,6 +72,10 @@ INSTALLED_APPS: list[str] = [
|
||||
"django.contrib.messages",
|
||||
"django.contrib.staticfiles",
|
||||
"ninja",
|
||||
"allauth",
|
||||
"allauth.account",
|
||||
"allauth.socialaccount",
|
||||
"allauth.socialaccount.providers.twitch",
|
||||
]
|
||||
|
||||
MIDDLEWARE: list[str] = [
|
||||
@ -83,6 +87,7 @@ MIDDLEWARE: list[str] = [
|
||||
"django.contrib.auth.middleware.AuthenticationMiddleware",
|
||||
"django.contrib.messages.middleware.MessageMiddleware",
|
||||
"django.middleware.clickjacking.XFrameOptionsMiddleware",
|
||||
"allauth.account.middleware.AccountMiddleware",
|
||||
]
|
||||
|
||||
|
||||
@ -155,3 +160,15 @@ LOGGING = {
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
LOGIN_URL = "/login/"
|
||||
LOGIN_REDIRECT_URL = "/"
|
||||
LOGOUT_REDIRECT_URL = "/"
|
||||
SOCIALACCOUNT_ONLY = True
|
||||
ACCOUNT_EMAIL_VERIFICATION = "none"
|
||||
|
||||
|
||||
AUTHENTICATION_BACKENDS: list[str] = [
|
||||
"django.contrib.auth.backends.ModelBackend",
|
||||
"allauth.account.auth_backends.AuthenticationBackend",
|
||||
]
|
||||
|
@ -1,21 +1,27 @@
|
||||
import logging
|
||||
|
||||
from django.contrib import admin
|
||||
from django.urls import URLPattern, include, path
|
||||
from django.urls.resolvers import URLResolver
|
||||
from ninja import NinjaAPI
|
||||
|
||||
from twitch.api import router as twitch_router
|
||||
from twitch_app.api import router as twitch_router
|
||||
|
||||
logger: logging.Logger = logging.getLogger(__name__)
|
||||
|
||||
api = NinjaAPI(
|
||||
title="TTVDrops API",
|
||||
version="1.0.0",
|
||||
description="No rate limits, but don't abuse it.",
|
||||
)
|
||||
|
||||
api.add_router(prefix="/twitch", router=twitch_router)
|
||||
|
||||
app_name: str = "config"
|
||||
|
||||
urlpatterns: list[URLPattern | URLResolver] = [
|
||||
path(route="admin/", view=admin.site.urls),
|
||||
path(route="accounts/", view=include(arg="allauth.urls")),
|
||||
path(route="", view=include(arg="core.urls")),
|
||||
path(route="api/", view=api.urls),
|
||||
]
|
||||
|
Reference in New Issue
Block a user