Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- """
- Django settings for footters project.
- Generated by 'django-admin startproject' using Django 2.2.5.
- 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 smuggler
- import django_heroku
- import whitenoise
- # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
- BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
- # Quick-start development settings - unsuitable for production
- # See https://docs.djangoproject.com/en/2.2/howto/deployment/checklist/
- # SECURITY WARNING: keep the secret key used in production secret!
- SECRET_KEY = '6mlgtjs6!vax6(zn@(d%3oy_6iv)%he*tj6b-@zwx(#zfi*#f2'
- if 'DYNO' in os.environ:
- BASEURL = 'https://footters-manager.herokuapp.com/'
- # SECURITY WARNING: don't run with debug turned on in production!
- if 'DYNO' in os.environ:
- DEBUG = False
- else:
- DEBUG = False
- if 'DYNO' in os.environ:
- SECURE_SSL_REDIRECT = True
- SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
- ALLOWED_HOSTS = ['localhost', '127.0.0.1','http://footters-manager.herokuapp.com/']
- VERSION=2
- # Application definition
- INSTALLED_APPS = [
- 'admin_shortcuts',
- 'django.contrib.admin',
- 'django.contrib.auth',
- 'django.contrib.contenttypes',
- 'django.contrib.sessions',
- 'django.contrib.messages',
- 'django.contrib.staticfiles',
- 'footters_app.apps.FoottersAppConfig',
- "colorfield",
- 'smuggler',
- 'rest_framework',
- ]
- MIDDLEWARE = [
- 'django.middleware.security.SecurityMiddleware',
- 'whitenoise.middleware.WhiteNoiseMiddleware',
- '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',
- ]
- SMUGGLER_FIXTURE_DIR = 'footters_app/fixtures'
- ROOT_URLCONF = 'footters.urls'
- TEMPLATES = [
- {
- 'BACKEND': 'django.template.backends.django.DjangoTemplates',
- 'DIRS': [os.path.join(BASE_DIR, '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 = 'footters.wsgi.application'
- ADMIN_SHORTCUTS = [
- {
- 'shortcuts': [
- {
- 'url': '/admin',
- 'icon': 'home'
- },
- {
- 'url_name': 'admin:logout',
- },
- {
- 'title': 'Usuarios',
- 'url_name': 'admin:auth_user_changelist',
- 'count': 'footters_app.admin_methods.count_users',
- },
- {
- 'title': 'Grupos',
- 'url_name': 'admin:auth_group_changelist',
- 'count': 'footters_app.admin_methods.count_groups',
- },
- {
- 'title': 'Añadir usuario',
- 'url_name': 'admin:auth_user_add',
- 'has_perms': 'footters_app.admin_methods.has_perms_to_users',
- },
- ]
- },
- {
- 'title': 'Utilidades',
- 'shortcuts': [
- {
- 'title': 'Documentación',
- 'icon': 'book',
- 'url_name': 'admin:index',
- },
- {
- 'title': 'Descargar datos',
- 'icon': 'download',
- 'url_name': ['dumpdata', "footters_app,auth"],
- },
- {
- 'title': 'Cargar datos',
- 'icon': 'upload',
- 'url_name': 'load-data',
- # 'count_new': '3',
- },
- {
- 'title': 'Añadir equipo real',
- 'url_name': 'admin:footters_app_equiporeal_add',
- 'icon': 'shield-alt'
- },
- {
- 'title': 'Añadir jugador',
- 'url_name': 'admin:footters_app_jugador_add',
- 'icon': 'futbol'
- },
- ]
- },
- ]
- REST_FRAMEWORK = {
- # Use Django's standard `django.contrib.auth` permissions,
- # or allow read-only access for unauthenticated users.
- 'DEFAULT_PERMISSION_CLASSES': [
- 'rest_framework.permissions.DjangoModelPermissionsOrAnonReadOnly'
- ]
- }
- ADMIN_SHORTCUTS_SETTINGS = {
- 'show_on_all_pages': True,
- 'hide_app_list': False,
- 'open_new_window': False,
- }
- # Database
- # https://docs.djangoproject.com/en/2.2/ref/settings/#databases
- DATABASES = {
- 'default': {
- 'ENGINE': 'django.db.backends.sqlite3',
- 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
- }
- }
- django_heroku.settings(locals())
- # 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-es'
- TIME_ZONE = 'UTC'
- USE_I18N = True
- USE_L10N = True
- USE_TZ = True
- # Static files (CSS, JavaScript, Images)
- # https://docs.djangoproject.com/en/2.2/howto/static-files/
- WSGI_APPLICATION = 'footters_app.wsgi.application'
- STATICFILES_DIRS = [
- os.path.join(BASE_DIR, 'static')
- ]
- PROJECT_ROOT = os.path.dirname(os.path.abspath(__file__))
- STATIC_ROOT = os.path.join(PROJECT_ROOT, 'static')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement