Eliminación de conflictos
This commit is contained in:
parent
0632c764fc
commit
3567a78776
|
@ -134,7 +134,7 @@ class MovieQuerySet(models.QuerySet):
|
|||
|
||||
def fix_path(self, el):
|
||||
if settings.DEBUG:
|
||||
return settings.URL_CDN.format(el)
|
||||
return settings.URL_DEBUG.format(el)
|
||||
else:
|
||||
return settings.MEDIA_ROOT / el
|
||||
|
||||
|
|
|
@ -0,0 +1,147 @@
|
|||
"""
|
||||
Django settings for mauflix project.
|
||||
|
||||
Generated by 'django-admin startproject' using Django 2.2.4.
|
||||
|
||||
For more information on this file, see
|
||||
https://docs.djangoproject.com/en/2.2/topics/settings/
|
||||
|
||||
For the full list of settings and their values, see
|
||||
https://docs.djangoproject.com/en/2.2/ref/settings/
|
||||
"""
|
||||
|
||||
import os
|
||||
import re
|
||||
|
||||
from .conf import (
|
||||
DEBUG,
|
||||
DEFAULT_DB,
|
||||
SECRET_KEY,
|
||||
TOKEN_MASTODON,
|
||||
TOKEN_TELEGRAM,
|
||||
CHAT_ID,
|
||||
API_TOKEN,
|
||||
)
|
||||
|
||||
|
||||
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
|
||||
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
||||
PATH_TEMPLATES = os.path.join(BASE_DIR, "templates")
|
||||
STATIC_ROOT = os.path.join(BASE_DIR, "static/")
|
||||
MEDIA_ROOT = os.path.join(BASE_DIR, "media/")
|
||||
MEDIA_URL = "media/"
|
||||
|
||||
|
||||
ALLOWED_HOSTS = ["mauflix.elmau.net", "elmau.net"]
|
||||
if DEBUG:
|
||||
ALLOWED_HOSTS = ["*"]
|
||||
|
||||
|
||||
# Application definition
|
||||
|
||||
INSTALLED_APPS = [
|
||||
"django_admin_listfilter_dropdown",
|
||||
"django.contrib.admin",
|
||||
"django.contrib.auth",
|
||||
"django.contrib.contenttypes",
|
||||
"django.contrib.sessions",
|
||||
"django.contrib.messages",
|
||||
"django.contrib.staticfiles",
|
||||
"main.apps.MainConfig",
|
||||
]
|
||||
|
||||
MIDDLEWARE = [
|
||||
"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",
|
||||
]
|
||||
|
||||
ROOT_URLCONF = "mauflix.urls"
|
||||
|
||||
TEMPLATES = [
|
||||
{
|
||||
"BACKEND": "django.template.backends.django.DjangoTemplates",
|
||||
"DIRS": [PATH_TEMPLATES],
|
||||
"APP_DIRS": True,
|
||||
"OPTIONS": {
|
||||
"context_processors": [
|
||||
"django.template.context_processors.debug",
|
||||
"django.template.context_processors.request",
|
||||
"django.contrib.auth.context_processors.auth",
|
||||
"django.contrib.messages.context_processors.messages",
|
||||
],
|
||||
},
|
||||
},
|
||||
]
|
||||
|
||||
WSGI_APPLICATION = "mauflix.wsgi.application"
|
||||
|
||||
|
||||
# Database
|
||||
# https://docs.djangoproject.com/en/2.2/ref/settings/#databases
|
||||
|
||||
DATABASES = {"default": DEFAULT_DB}
|
||||
|
||||
|
||||
# Password validation
|
||||
# https://docs.djangoproject.com/en/2.2/ref/settings/#auth-password-validators
|
||||
|
||||
AUTH_PASSWORD_VALIDATORS = [
|
||||
{
|
||||
"NAME": "django.contrib.auth.password_validation.UserAttributeSimilarityValidator",
|
||||
},
|
||||
{
|
||||
"NAME": "django.contrib.auth.password_validation.MinimumLengthValidator",
|
||||
},
|
||||
{
|
||||
"NAME": "django.contrib.auth.password_validation.CommonPasswordValidator",
|
||||
},
|
||||
{
|
||||
"NAME": "django.contrib.auth.password_validation.NumericPasswordValidator",
|
||||
},
|
||||
]
|
||||
|
||||
|
||||
# Internationalization
|
||||
# https://docs.djangoproject.com/en/2.2/topics/i18n/
|
||||
|
||||
LANGUAGE_CODE = "es-MX"
|
||||
|
||||
TIME_ZONE = "America/Mexico_City"
|
||||
|
||||
USE_I18N = True
|
||||
|
||||
USE_L10N = True
|
||||
|
||||
USE_TZ = False
|
||||
|
||||
|
||||
# Static files (CSS, JavaScript, Images)
|
||||
# https://docs.djangoproject.com/en/2.2/howto/static-files/
|
||||
|
||||
STATIC_URL = "/static/"
|
||||
STATICFILES_DIRS = [
|
||||
os.path.join(BASE_DIR, "main/static/"),
|
||||
]
|
||||
|
||||
DISALLOWED_USER_AGENTS = (
|
||||
re.compile(r".*Googlebot", re.IGNORECASE),
|
||||
re.compile(r".*Spider", re.IGNORECASE),
|
||||
re.compile(r".*bingbot", re.IGNORECASE),
|
||||
re.compile(r".*MJ12bot", re.IGNORECASE),
|
||||
re.compile(r".*Slurp", re.IGNORECASE),
|
||||
re.compile(r".*python-requests", re.IGNORECASE),
|
||||
re.compile(r".*Netcraft", re.IGNORECASE),
|
||||
re.compile(r".*AhrefsBot", re.IGNORECASE),
|
||||
)
|
||||
|
||||
SESSION_EXPIRE_AT_BROWSER_CLOSE = True
|
||||
SESSION_COOKIE_AGE = 3600
|
||||
|
||||
URL_DEBUG = "http://124.124.24.24/mauflix/{}"
|
||||
URL_CDN = "https://mauflix.elmau.net/{}"
|
||||
URL_MASTODON = "https://mstdn.mx/"
|
Loading…
Reference in New Issue