59 lines
1.8 KiB
Python
59 lines
1.8 KiB
Python
# -*- coding: utf-8 -*-
|
|
# type: ignore
|
|
from __future__ import annotations
|
|
|
|
import os
|
|
|
|
from .base import * # noqa: F401,F403
|
|
|
|
INSTALLED_APPS += [ # noqa: F405
|
|
'crispy_forms',
|
|
'crispy_bootstrap5',
|
|
'django_htmx',
|
|
]
|
|
|
|
MIDDLEWARE = [
|
|
'hotpocket_backend.apps.core.middleware.RequestIDMiddleware',
|
|
'django.middleware.security.SecurityMiddleware',
|
|
'django.contrib.sessions.middleware.SessionMiddleware',
|
|
'django.middleware.common.CommonMiddleware',
|
|
'django.middleware.csrf.CsrfViewMiddleware',
|
|
'django.contrib.auth.middleware.AuthenticationMiddleware',
|
|
'django.contrib.messages.middleware.MessageMiddleware',
|
|
'django.middleware.clickjacking.XFrameOptionsMiddleware',
|
|
'social_django.middleware.SocialAuthExceptionMiddleware',
|
|
'django_htmx.middleware.HtmxMiddleware',
|
|
]
|
|
|
|
ROOT_URLCONF = 'hotpocket_backend.urls.webapp'
|
|
|
|
LOGIN_REDIRECT_URL = '/accounts/post-login/'
|
|
|
|
CRISPY_ALLOWED_TEMPLATE_PACKS = 'bootstrap5'
|
|
CRISPY_TEMPLATE_PACK = 'bootstrap5'
|
|
|
|
HOTPOCKET_BOT_STRATEGY = 'hotpocket_backend.apps.bot.strategy.basic:BasicStrategy'
|
|
HOTPOCKET_BOT_BANNED_HOSTNAMES = [
|
|
# YT returns dummy data when I try to fetch the page and extract
|
|
# metadata. I'd have to use Google APIs for that and it's 11:30 PM...
|
|
'youtube.com',
|
|
'youtu.be',
|
|
# Reddit's response is too generic to pull any useful info from it.
|
|
# Since they forced Apollo to shut down, I refuse to even think about
|
|
# interacting with their API :P.
|
|
'reddit.com',
|
|
# Twitter, amirite?
|
|
'twitter.com',
|
|
't.co',
|
|
'x.com',
|
|
]
|
|
|
|
SAVES_SAVE_ADAPTER = os.environ.get(
|
|
'HOTPOCKET_BACKEND_SAVES_SAVE_ADAPTER',
|
|
'hotpocket_backend.apps.saves.adapters.basic:BasicSaveAdapter',
|
|
)
|
|
SAVES_ASSOCIATION_ADAPTER = os.environ.get(
|
|
'HOTPOCKET_BACKEND_SAVES_ASSOCIATION_ADAPTER',
|
|
'hotpocket_backend.apps.saves.adapters.basic:BasicAssociationAdapter',
|
|
)
|