SILENCED_SYSTEM_CHECKS = ["axes.W002"]

url = urlparse(SITE_URL)

ADMINS: List[Tuple[str, str]] = [("webmaster", "*****@*****.**")]
MANAGERS = ADMINS
ADMIN_USER = env.dict("ADMIN_USER")
ALLOWED_HOSTS: List[str] = [url.hostname or url.netloc]
CORS_ORIGIN_WHITELIST: List[str] = [SITE_URL]

# Services
CELERY_BROKER_URL = env("CELERY_BROKER_URL")
# NOTE: This needs to be set to something unique per site so that the different
# celery instances data is namespaced on the shared broker (probably redis)
CELERY_TASK_DEFAULT_QUEUE = env.str("CELERY_TASK_DEFAULT_QUEUE")
DATABASES = {"default": env.db_url(default=default_databse_url)}

# Storage
DEFAULT_FILE_STORAGE = "webapp.storage.MediaS3"
STATICFILES_STORAGE = "webapp.storage.StaticS3"

AWS_S3_REGION_NAME = env("AWS_S3_REGION_NAME")
AWS_STORAGE_BUCKET_NAME = env("AWS_STORAGE_BUCKET_NAME")

INSTALLED_APPS = [
    # Project apps
    "webapp.apps.WebAppConfig",
    "users.apps.UsersConfig",
    # Our defaults
    "corsheaders",
    "anymail",
            '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 = 'api.wsgi.application'

# Database
# https://docs.djangoproject.com/en/3.1/ref/settings/#databases

DATABASES = {'default': env.db_url('DATABASE_URL')}

# Password validation
# https://docs.djangoproject.com/en/3.1/ref/settings/#auth-password-validators

AUTH_PASSWORD_VALIDATORS = [
    {
        'NAME':
        'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
    },
    {
        'NAME':
        'django.contrib.auth.password_validation.MinimumLengthValidator',
    },
    {
        'NAME':
MEDIA_ROOT = os.path.join(VAR_ROOT, 'media')
MEDIA_URL = '/media/'
ROOT_URLCONF = 'parkkihubi.urls'
STATIC_ROOT = os.path.join(VAR_ROOT, 'static')
STATIC_URL = '/static/'

############
# Database #
############
if os.environ.get('CI'):
    default_database_url = 'postgis://postgres:@localhost/parkkihubi'
else:
    default_database_url = 'postgis://*****:*****@localhost/parkkihubi'

DATABASES = {'default': env.db_url(default=default_database_url)}

##########
# Caches #
##########
CACHES = {'default': env.cache_url(default='locmemcache://')}

##################
# Installed apps #
##################
INSTALLED_APPS = [
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
MEDIA_URL = '/media/'
ROOT_URLCONF = 'parkkihubi.urls'
STATIC_ROOT = os.path.join(VAR_ROOT, 'static')
STATIC_URL = '/static/'

############
# Database #
############
if os.environ.get('CI'):
    default_database_url = 'postgis://postgres:@localhost/parkkihubi'
else:
    default_database_url = 'postgis://*****:*****@localhost/parkkihubi'

DATABASES = {
    'default': env.db_url(
        default=default_database_url
    )
}

##########
# Caches #
##########
CACHES = {'default': env.cache_url(default='locmemcache://')}

##################
# Installed apps #
##################
INSTALLED_APPS = [
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
Exemple #5
0
#     "default": {
#         "BACKEND": "channels_redis.core.RedisChannelLayer",
#         "CONFIG": {
#             # "hosts": [("127.0.0.1", 6379)],
#             "hosts": layers_hosts,
#         },
#     },
# }

CHANNEL_LAYERS = {
    "default": {
        "BACKEND": "channels.layers.InMemoryChannelLayer"
    }
}

DATABASES = {"default": env.db_url()}

AUTH_PASSWORD_VALIDATORS = [
    {
        "NAME":
        "django.contrib.auth.password_validation.UserAttributeSimilarityValidator"
    },
    {
        "NAME":
        "django.contrib.auth.password_validation.MinimumLengthValidator"
    },
    {
        "NAME":
        "django.contrib.auth.password_validation.CommonPasswordValidator"
    },
    {
from environ import Env


BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
assert os.path.isfile(os.path.join(BASE_DIR, 'manage.py'))

env = Env()
env.read_env(os.path.join(BASE_DIR, '.env'))

DEBUG = env.bool('DEBUG', default=False)
SECRET_KEY = env.str('SECRET_KEY', default=('' if not DEBUG else 'xxx'))

DATABASES = {
    'default': env.db_url(
        default='psql://*****:*****@postgres/tallessa',
    ),
}

CACHES = {'default': env.cache_url(default='locmemcache://')}

INSTALLED_APPS = [
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',

    'rest_framework',
Exemple #7
0
                'django.template.context_processors.debug',
                'django.template.context_processors.request',
                'django.contrib.auth.context_processors.auth',
                'django.contrib.messages.context_processors.messages',
            ],
        },
    },
]

WSGI_APPLICATION = 'config.wsgi.application'

# Database
# https://docs.djangoproject.com/en/2.2/ref/settings/#databases

DATABASES = {
    'default': env.db_url('DATABASE_URL', default="postgres://*****:*****@localhost:5432/postgres"),
}



# 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',
    },
    {
Exemple #8
0
TEMPLATES = [{
    "BACKEND": "django.template.backends.django.DjangoTemplates",
    "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",
        ]
    },
}]

DATABASES = {
    "default":
    env.db_url(default="sqlite:///%s" % os.path.join(BASE_DIR, "db.sqlite3"))
}

AUTH_PASSWORD_VALIDATORS = [
    {
        "NAME":
        "django.contrib.auth.password_validation.UserAttributeSimilarityValidator"
    },
    {
        "NAME":
        "django.contrib.auth.password_validation.MinimumLengthValidator"
    },
    {
        "NAME":
        "django.contrib.auth.password_validation.CommonPasswordValidator"
    },
Exemple #9
0
        }
    },
    "loggers": {
        "boltstream": {
            "handlers": ["console"],
            "level": LOG_LEVEL
        }
    },
}

# Database
# https://docs.djangoproject.com/en/2.0/ref/settings/#databases

DATABASES = {
    "default":
    ENV.db_url(
        default="sqlite:///{}".format(os.path.join(BASE_DIR, "db.sqlite3")))
}

CACHES = {"default": ENV.cache_url(default="dummycache://")}

AUTHENTICATION_BACKENDS = ("boltstream.auth.UsernameOrEmailModelBackend", )

AUTH_USER_MODEL = "boltstream.User"
AUTH_PROFILE_MODEL = "boltstream.Profile"
SESSION_ENGINE = ENV.str("SESSION_ENGINE",
                         "django.contrib.sessions.backends.signed_cookies")
SESSION_COOKIE_HTTPONLY = True
SESSION_COOKIE_NAME = ENV.str("SESSION_COOKIE_NAME", "sessionid")
SESSION_COOKIE_DOMAIN = ENV.str("SESSION_COOKIE_DOMAIN", None)
SESSION_COOKIE_SECURE = ENV.bool("REQUIRE_HTTPS", not DEBUG)
Exemple #10
0
import os

import babel
from environ import Env

env = Env()
DEBUG = env.bool('DEBUG', default=False)
SECRET_KEY = env.str('SECRET_KEY', default=('cfh' if DEBUG else Env.NOTSET))
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
ALLOWED_HOSTS = ['*']

DATABASES = {
    'default': env.db_url(default='postgis://*****:*****@localhost:5432/cfh')
}

INSTALLED_APPS = list(
    filter(None, [
        'django.contrib.admin', 'django.contrib.auth',
        'django.contrib.contenttypes', 'django.contrib.sessions',
        'django.contrib.messages', 'django.contrib.staticfiles',
        'django.contrib.gis', 'rest_framework', 'parler', 'cfh', 'issues',
        'issues_citysdk', 'issues_media', 'issues_hel', 'issues_log',
        'issues_simple_ui',
        ('issues_geometry' if
         ('gis' in DATABASES['default']['ENGINE']) else None)
    ]))

MIDDLEWARE = [
    'django.middleware.security.SecurityMiddleware',
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.middleware.common.CommonMiddleware',
Exemple #11
0
                'django.template.context_processors.request',
                'django.contrib.auth.context_processors.auth',
                'django.contrib.messages.context_processors.messages',
            ],
        },
    },
]

WSGI_APPLICATION = 'movies.wsgi.application'

# Database
# https://docs.djangoproject.com/en/3.1/ref/settings/#databases

DATABASES = {
    'default':
    env.db_url('DATABASE_URL',
               default='sqlite://' + str(BASE_DIR / 'db.sqlite3')),
}

# NOTE: explicitly configuring this value removes a warning from Django
DEFAULT_AUTO_FIELD = 'django.db.models.AutoField'

# Password validation
# https://docs.djangoproject.com/en/3.1/ref/settings/#auth-password-validators

AUTH_PASSWORD_VALIDATORS = [
    {
        'NAME':
        'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
    },
    {
        'NAME':
Exemple #12
0
import os

import babel
from environ import Env

env = Env()
DEBUG = env.bool('DEBUG', default=False)
SECRET_KEY = env.str('SECRET_KEY', default=('cfh' if DEBUG else Env.NOTSET))
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
ALLOWED_HOSTS = ['*']

DATABASES = {
    'default': env.db_url(default='postgis://*****:*****@localhost:5432/cfh')
}

INSTALLED_APPS = list(filter(None, [
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'django.contrib.gis',
    'rest_framework',
    'parler',
    'cfh',
    'issues',
    'issues_citysdk',
    'issues_media',
    'issues_hel',
    'issues_log',
Exemple #13
0
        'BACKEND': 'django.template.backends.django.DjangoTemplates',
        'DIRS': [],
        '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',
            ],
        },
    },
]
DATABASES = {
    'default':
    env.db_url('DATABASE_URL',
               default='sqlite:///%s' % os.path.join(VAR_DIR, 'db.sqlite3')),
}
AUTH_PASSWORD_VALIDATORS = [
    {
        'NAME':
        'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
    },
    {
        'NAME':
        'django.contrib.auth.password_validation.MinimumLengthValidator',
    },
    {
        'NAME':
        'django.contrib.auth.password_validation.CommonPasswordValidator',
    },
    {
Exemple #14
0
import os

from environ import Env

env = Env()
HOME_DIR = env.str(
    "HOME_DIR",
    default=os.path.realpath(os.path.join(os.path.dirname(__file__), ".."))
)

env.read_env(os.path.join(HOME_DIR, ".env"))
DEBUG = env.bool("DEBUG", False)
SECRET_KEY = env.bool("SECRET_KEY", "Sehr lecker Wurst" if DEBUG else Env.NOTSET)
ALLOWED_HOSTS = env.list("ALLOWED_HOSTS", default=["*"])
DATABASES = {
    "default": env.db_url(default="sqlite:///%s" % os.path.join(HOME_DIR, "wurst.sqlite3"))
}
STATIC_ROOT = env.str("STATIC_ROOT", default=os.path.join(HOME_DIR, "static"))
MEDIA_ROOT = env.str("MEDIA_ROOT", default=os.path.join(HOME_DIR, "media"))

INSTALLED_APPS = [
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'reversion',
    'rest_framework',
    'rest_framework.authtoken',
    'wurst.core',
import django
from environ import Env

env = Env()

DATABASES = {
    "default":
    env.db_url(
        "DATABASE_URL",
        default=
        "postgres://localhost/gisserver",  # default homebrew user is superuser
        engine="django.contrib.gis.db.backends.postgis",
    )
}

if django.VERSION >= (3, 2):
    DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField"

GISSERVER_USE_DB_RENDERING = env.bool("GISSERVER_USE_DB_RENDERING",
                                      default=True)

INSTALLED_APPS = [
    "gisserver",
    "tests.test_gisserver",
    "django.contrib.postgres",
]

# Test session requirements

SECRET_KEY = "insecure-tests-only"
Exemple #16
0
        "BACKEND": "django.template.backends.django.DjangoTemplates",
        "DIRS": [],
        "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",
            ],
        },
    },
]

DATABASES = {
    "default": env.db_url(default="sqlite:///%s" % os.path.join(BASE_DIR, "db.sqlite3")),
}


# local_settings.py can be used to override environment-specific settings
# like database and email that differ between development and production.
f = os.path.join(BASE_DIR, "local_settings.py")
if os.path.exists(f):
    import sys
    import imp
    module_name = "%s.local_settings" % ROOT_URLCONF.split('.')[0]
    module = imp.new_module(module_name)
    module.__file__ = f
    sys.modules[module_name] = module
    exec(open(f, "rb").read())