Apply Black to settings files
This commit is contained in:
parent
6008146110
commit
af3518ad08
4 changed files with 220 additions and 222 deletions
|
@ -8,42 +8,41 @@ from .base import * # NOQA, default values
|
||||||
|
|
||||||
# Allow to override setting from any file, may be out of the PYTHONPATH,
|
# Allow to override setting from any file, may be out of the PYTHONPATH,
|
||||||
# to make it easier for non python people.
|
# to make it easier for non python people.
|
||||||
path = os.environ.get('UMAP_SETTINGS')
|
path = os.environ.get("UMAP_SETTINGS")
|
||||||
if not path:
|
if not path:
|
||||||
# Retrocompat
|
# Retrocompat
|
||||||
path = os.path.join('/etc', 'umap', 'umap.conf')
|
path = os.path.join("/etc", "umap", "umap.conf")
|
||||||
if not os.path.exists(path):
|
if not os.path.exists(path):
|
||||||
# Retrocompat
|
# Retrocompat
|
||||||
path = os.path.join(os.path.dirname(os.path.realpath(__file__)),
|
path = os.path.join(os.path.dirname(os.path.realpath(__file__)), "local.py")
|
||||||
'local.py')
|
|
||||||
if not os.path.exists(path):
|
if not os.path.exists(path):
|
||||||
print(colorize('No valid UMAP_SETTINGS found', fg='yellow'))
|
print(colorize("No valid UMAP_SETTINGS found", fg="yellow"))
|
||||||
path = None
|
path = None
|
||||||
|
|
||||||
if path:
|
if path:
|
||||||
d = types.ModuleType('config')
|
d = types.ModuleType("config")
|
||||||
d.__file__ = path
|
d.__file__ = path
|
||||||
try:
|
try:
|
||||||
with open(path) as config_file:
|
with open(path) as config_file:
|
||||||
exec(compile(config_file.read(), path, 'exec'), d.__dict__)
|
exec(compile(config_file.read(), path, "exec"), d.__dict__)
|
||||||
except IOError as e:
|
except IOError as e:
|
||||||
msg = 'Unable to import {} from UMAP_SETTINGS'.format(path)
|
msg = "Unable to import {} from UMAP_SETTINGS".format(path)
|
||||||
print(colorize(msg, fg='red'))
|
print(colorize(msg, fg="red"))
|
||||||
sys.exit(e)
|
sys.exit(e)
|
||||||
else:
|
else:
|
||||||
print('Loaded local config from', path)
|
print("Loaded local config from", path)
|
||||||
for key in dir(d):
|
for key in dir(d):
|
||||||
if key.isupper():
|
if key.isupper():
|
||||||
value = getattr(d, key)
|
value = getattr(d, key)
|
||||||
if key.startswith('LEAFLET_STORAGE'):
|
if key.startswith("LEAFLET_STORAGE"):
|
||||||
# Retrocompat pre 1.0, remove me in 1.1.
|
# Retrocompat pre 1.0, remove me in 1.1.
|
||||||
globals()['UMAP' + key[15:]] = value
|
globals()["UMAP" + key[15:]] = value
|
||||||
elif key == 'UMAP_CUSTOM_TEMPLATES':
|
elif key == "UMAP_CUSTOM_TEMPLATES":
|
||||||
if 'DIRS' in globals()['TEMPLATES'][0]:
|
if "DIRS" in globals()["TEMPLATES"][0]:
|
||||||
globals()['TEMPLATES'][0]['DIRS'].insert(0, value)
|
globals()["TEMPLATES"][0]["DIRS"].insert(0, value)
|
||||||
else:
|
else:
|
||||||
globals()['TEMPLATES'][0]['DIRS'] = [value]
|
globals()["TEMPLATES"][0]["DIRS"] = [value]
|
||||||
elif key == 'UMAP_CUSTOM_STATICS':
|
elif key == "UMAP_CUSTOM_STATICS":
|
||||||
globals()['STATICFILES_DIRS'].insert(0, value)
|
globals()["STATICFILES_DIRS"].insert(0, value)
|
||||||
else:
|
else:
|
||||||
globals()[key] = value
|
globals()[key] = value
|
||||||
|
|
|
@ -13,120 +13,121 @@ env = environ.Env()
|
||||||
# =============================================================================
|
# =============================================================================
|
||||||
|
|
||||||
|
|
||||||
INTERNAL_IPS = env.list('INTERNAL_IPS', default=['127.0.0.1'])
|
INTERNAL_IPS = env.list("INTERNAL_IPS", default=["127.0.0.1"])
|
||||||
ALLOWED_HOSTS = env.list('ALLOWED_HOSTS', default=['*'])
|
ALLOWED_HOSTS = env.list("ALLOWED_HOSTS", default=["*"])
|
||||||
ADMINS = tuple(parseaddr(email) for email in env.list('ADMINS', default=[]))
|
ADMINS = tuple(parseaddr(email) for email in env.list("ADMINS", default=[]))
|
||||||
|
|
||||||
|
|
||||||
DEBUG = env.bool('DEBUG', default=False)
|
DEBUG = env.bool("DEBUG", default=False)
|
||||||
|
|
||||||
SITE_ID = 1
|
SITE_ID = 1
|
||||||
# Add languages we're missing from Django
|
# Add languages we're missing from Django
|
||||||
LANG_INFO.update({
|
LANG_INFO.update(
|
||||||
'am-et': {
|
{
|
||||||
'bidi': False,
|
"am-et": {
|
||||||
'name': 'Amharic',
|
"bidi": False,
|
||||||
'code': 'am-et',
|
"name": "Amharic",
|
||||||
'name_local': 'አማርኛ'
|
"code": "am-et",
|
||||||
},
|
"name_local": "አማርኛ",
|
||||||
'zh': {
|
},
|
||||||
'bidi': False,
|
"zh": {
|
||||||
'code': 'zh',
|
"bidi": False,
|
||||||
'name': 'Chinese',
|
"code": "zh",
|
||||||
'name_local': '简体中文',
|
"name": "Chinese",
|
||||||
},
|
"name_local": "简体中文",
|
||||||
'si': {
|
},
|
||||||
'bidi': False,
|
"si": {
|
||||||
'code': 'si',
|
"bidi": False,
|
||||||
'name': 'Sinhala',
|
"code": "si",
|
||||||
'name_local': 'සිංහල',
|
"name": "Sinhala",
|
||||||
},
|
"name_local": "සිංහල",
|
||||||
"ms": {
|
},
|
||||||
"bidi": False,
|
"ms": {
|
||||||
"code": "ms",
|
"bidi": False,
|
||||||
"name": "Malay",
|
"code": "ms",
|
||||||
"name_local": "Bahasa Melayu",
|
"name": "Malay",
|
||||||
},
|
"name_local": "Bahasa Melayu",
|
||||||
})
|
},
|
||||||
|
}
|
||||||
|
)
|
||||||
# Local time zone for this installation. Choices can be found here:
|
# Local time zone for this installation. Choices can be found here:
|
||||||
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
|
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
|
||||||
TIME_ZONE = 'UTC'
|
TIME_ZONE = "UTC"
|
||||||
USE_TZ = True
|
USE_TZ = True
|
||||||
USE_I18N = True
|
USE_I18N = True
|
||||||
LANGUAGE_CODE = 'en'
|
LANGUAGE_CODE = "en"
|
||||||
LANGUAGES = (
|
LANGUAGES = (
|
||||||
('am-et', 'Amharic'),
|
("am-et", "Amharic"),
|
||||||
('ar', 'Arabic'),
|
("ar", "Arabic"),
|
||||||
('ast', 'Asturian'),
|
("ast", "Asturian"),
|
||||||
('bg', 'Bulgarian'),
|
("bg", "Bulgarian"),
|
||||||
('br', 'Breton'),
|
("br", "Breton"),
|
||||||
('ca', 'Catalan'),
|
("ca", "Catalan"),
|
||||||
('cs-cz', 'Czech'),
|
("cs-cz", "Czech"),
|
||||||
('da', 'Danish'),
|
("da", "Danish"),
|
||||||
('de', 'German'),
|
("de", "German"),
|
||||||
('el', 'Greek'),
|
("el", "Greek"),
|
||||||
('en', 'English'),
|
("en", "English"),
|
||||||
('es', 'Spanish'),
|
("es", "Spanish"),
|
||||||
('et', 'Estonian'),
|
("et", "Estonian"),
|
||||||
('eu', 'Basque'),
|
("eu", "Basque"),
|
||||||
('fa-ir', 'Persian (Iran)'),
|
("fa-ir", "Persian (Iran)"),
|
||||||
('fi', 'Finnish'),
|
("fi", "Finnish"),
|
||||||
('fr', 'French'),
|
("fr", "French"),
|
||||||
('gl', 'Galician'),
|
("gl", "Galician"),
|
||||||
('he', 'Hebrew'),
|
("he", "Hebrew"),
|
||||||
('hr', 'Croatian'),
|
("hr", "Croatian"),
|
||||||
('hu', 'Hungarian'),
|
("hu", "Hungarian"),
|
||||||
('id', 'Indonesian'),
|
("id", "Indonesian"),
|
||||||
('is', 'Icelandic'),
|
("is", "Icelandic"),
|
||||||
('it', 'Italian'),
|
("it", "Italian"),
|
||||||
('ja', 'Japanese'),
|
("ja", "Japanese"),
|
||||||
('ko', 'Korean'),
|
("ko", "Korean"),
|
||||||
('lt', 'Lithuanian'),
|
("lt", "Lithuanian"),
|
||||||
('ms', 'Malay'),
|
("ms", "Malay"),
|
||||||
('nl', 'Dutch'),
|
("nl", "Dutch"),
|
||||||
('no', 'Norwegian'),
|
("no", "Norwegian"),
|
||||||
('pl', 'Polish'),
|
("pl", "Polish"),
|
||||||
('pt', 'Portuguese'),
|
("pt", "Portuguese"),
|
||||||
('pt-br', 'Portuguese (Brazil)'),
|
("pt-br", "Portuguese (Brazil)"),
|
||||||
('pt-pt', 'Portuguese (Portugal)'),
|
("pt-pt", "Portuguese (Portugal)"),
|
||||||
('ro', 'Romanian'),
|
("ro", "Romanian"),
|
||||||
('ru', 'Russian'),
|
("ru", "Russian"),
|
||||||
('si', 'Sinhala'),
|
("si", "Sinhala"),
|
||||||
('sk-sk', 'Slovak'),
|
("sk-sk", "Slovak"),
|
||||||
('sl', 'Slovenian'),
|
("sl", "Slovenian"),
|
||||||
('sr', 'Serbian'),
|
("sr", "Serbian"),
|
||||||
('sv', 'Swedish'),
|
("sv", "Swedish"),
|
||||||
('th-th', 'Thai (Thailand)'),
|
("th-th", "Thai (Thailand)"),
|
||||||
('tr', 'Turkish'),
|
("tr", "Turkish"),
|
||||||
('uk-ua', 'Ukrainian'),
|
("uk-ua", "Ukrainian"),
|
||||||
('vi', 'Vietnamese'),
|
("vi", "Vietnamese"),
|
||||||
('zh', 'Chinese'),
|
("zh", "Chinese"),
|
||||||
('zh-tw', 'Chinese (Taiwan)'),
|
("zh-tw", "Chinese (Taiwan)"),
|
||||||
)
|
)
|
||||||
|
|
||||||
# Make this unique, and don't share it with anybody.
|
# Make this unique, and don't share it with anybody.
|
||||||
SECRET_KEY = env('SECRET_KEY', default=None)
|
SECRET_KEY = env("SECRET_KEY", default=None)
|
||||||
|
|
||||||
INSTALLED_APPS = (
|
INSTALLED_APPS = (
|
||||||
'django.contrib.auth',
|
"django.contrib.auth",
|
||||||
'django.contrib.contenttypes',
|
"django.contrib.contenttypes",
|
||||||
'django.contrib.sessions',
|
"django.contrib.sessions",
|
||||||
'django.contrib.sites',
|
"django.contrib.sites",
|
||||||
'django.contrib.messages',
|
"django.contrib.messages",
|
||||||
'django.contrib.staticfiles',
|
"django.contrib.staticfiles",
|
||||||
'django.contrib.admin',
|
"django.contrib.admin",
|
||||||
'django.contrib.gis',
|
"django.contrib.gis",
|
||||||
|
"django_probes",
|
||||||
'django_probes',
|
"umap",
|
||||||
'umap',
|
"compressor",
|
||||||
'compressor',
|
"social_django",
|
||||||
'social_django',
|
|
||||||
# See https://github.com/peopledoc/django-agnocomplete/commit/26eda2dfa4a2f8a805ca2ea19a0c504b9d773a1c
|
# See https://github.com/peopledoc/django-agnocomplete/commit/26eda2dfa4a2f8a805ca2ea19a0c504b9d773a1c
|
||||||
# Django does not find the app config in the default place, so the app is not loaded
|
# Django does not find the app config in the default place, so the app is not loaded
|
||||||
# so the "autodiscover" is not run.
|
# so the "autodiscover" is not run.
|
||||||
'agnocomplete.app.AgnocompleteConfig',
|
"agnocomplete.app.AgnocompleteConfig",
|
||||||
)
|
)
|
||||||
DEFAULT_AUTO_FIELD = 'django.db.models.AutoField'
|
DEFAULT_AUTO_FIELD = "django.db.models.AutoField"
|
||||||
|
|
||||||
EMAIL_BACKEND = "django.core.mail.backends.console.EmailBackend"
|
EMAIL_BACKEND = "django.core.mail.backends.console.EmailBackend"
|
||||||
FROM_EMAIL = None
|
FROM_EMAIL = None
|
||||||
|
@ -147,23 +148,23 @@ PROJECT_DIR = os.path.dirname(os.path.realpath(project_module.__file__))
|
||||||
# Project URLS and media settings
|
# Project URLS and media settings
|
||||||
# =============================================================================
|
# =============================================================================
|
||||||
|
|
||||||
ROOT_URLCONF = 'umap.urls'
|
ROOT_URLCONF = "umap.urls"
|
||||||
WSGI_APPLICATION = 'umap.wsgi.application'
|
WSGI_APPLICATION = "umap.wsgi.application"
|
||||||
|
|
||||||
LOGIN_URL = '/login/'
|
LOGIN_URL = "/login/"
|
||||||
LOGOUT_URL = '/logout/'
|
LOGOUT_URL = "/logout/"
|
||||||
LOGIN_REDIRECT_URL = '/'
|
LOGIN_REDIRECT_URL = "/"
|
||||||
|
|
||||||
STATIC_URL = '/static/'
|
STATIC_URL = "/static/"
|
||||||
MEDIA_URL = '/uploads/'
|
MEDIA_URL = "/uploads/"
|
||||||
|
|
||||||
STATIC_ROOT = os.path.join('static')
|
STATIC_ROOT = os.path.join("static")
|
||||||
MEDIA_ROOT = os.path.join('uploads')
|
MEDIA_ROOT = os.path.join("uploads")
|
||||||
|
|
||||||
STATICFILES_FINDERS = [
|
STATICFILES_FINDERS = [
|
||||||
'django.contrib.staticfiles.finders.FileSystemFinder',
|
"django.contrib.staticfiles.finders.FileSystemFinder",
|
||||||
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
|
"django.contrib.staticfiles.finders.AppDirectoriesFinder",
|
||||||
'compressor.finders.CompressorFinder',
|
"compressor.finders.CompressorFinder",
|
||||||
]
|
]
|
||||||
STATICFILES_DIRS = [] # May be extended when using UMAP_CUSTOM_STATICS
|
STATICFILES_DIRS = [] # May be extended when using UMAP_CUSTOM_STATICS
|
||||||
|
|
||||||
|
@ -173,24 +174,24 @@ STATICFILES_DIRS = [] # May be extended when using UMAP_CUSTOM_STATICS
|
||||||
|
|
||||||
TEMPLATES = [
|
TEMPLATES = [
|
||||||
{
|
{
|
||||||
'BACKEND': 'django.template.backends.django.DjangoTemplates',
|
"BACKEND": "django.template.backends.django.DjangoTemplates",
|
||||||
'APP_DIRS': True,
|
"APP_DIRS": True,
|
||||||
'OPTIONS': {
|
"OPTIONS": {
|
||||||
'context_processors': (
|
"context_processors": (
|
||||||
'django.contrib.auth.context_processors.auth',
|
"django.contrib.auth.context_processors.auth",
|
||||||
'django.template.context_processors.debug',
|
"django.template.context_processors.debug",
|
||||||
'django.template.context_processors.i18n',
|
"django.template.context_processors.i18n",
|
||||||
'django.template.context_processors.request',
|
"django.template.context_processors.request",
|
||||||
'django.template.context_processors.media',
|
"django.template.context_processors.media",
|
||||||
'django.template.context_processors.static',
|
"django.template.context_processors.static",
|
||||||
'django.template.context_processors.tz',
|
"django.template.context_processors.tz",
|
||||||
'django.contrib.messages.context_processors.messages',
|
"django.contrib.messages.context_processors.messages",
|
||||||
'social_django.context_processors.backends',
|
"social_django.context_processors.backends",
|
||||||
'social_django.context_processors.login_redirect',
|
"social_django.context_processors.login_redirect",
|
||||||
'umap.context_processors.settings',
|
"umap.context_processors.settings",
|
||||||
'umap.context_processors.version',
|
"umap.context_processors.version",
|
||||||
)
|
)
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -200,13 +201,13 @@ TEMPLATES = [
|
||||||
# =============================================================================
|
# =============================================================================
|
||||||
|
|
||||||
MIDDLEWARE = (
|
MIDDLEWARE = (
|
||||||
'django.contrib.sessions.middleware.SessionMiddleware',
|
"django.contrib.sessions.middleware.SessionMiddleware",
|
||||||
'django.middleware.locale.LocaleMiddleware',
|
"django.middleware.locale.LocaleMiddleware",
|
||||||
'django.middleware.common.CommonMiddleware',
|
"django.middleware.common.CommonMiddleware",
|
||||||
'umap.middleware.readonly_middleware',
|
"umap.middleware.readonly_middleware",
|
||||||
'django.middleware.csrf.CsrfViewMiddleware',
|
"django.middleware.csrf.CsrfViewMiddleware",
|
||||||
'django.contrib.auth.middleware.AuthenticationMiddleware',
|
"django.contrib.auth.middleware.AuthenticationMiddleware",
|
||||||
'django.contrib.messages.middleware.MessageMiddleware',
|
"django.contrib.messages.middleware.MessageMiddleware",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -229,36 +230,36 @@ USER_URL_FIELD = "username"
|
||||||
UMAP_ALLOW_ANONYMOUS = env.bool("UMAP_ALLOW_ANONYMOUS", default=False)
|
UMAP_ALLOW_ANONYMOUS = env.bool("UMAP_ALLOW_ANONYMOUS", default=False)
|
||||||
|
|
||||||
UMAP_EXTRA_URLS = {
|
UMAP_EXTRA_URLS = {
|
||||||
'routing': 'http://www.openstreetmap.org/directions?engine=osrm_car&route={lat},{lng}&locale={locale}#map={zoom}/{lat}/{lng}', # noqa
|
"routing": "http://www.openstreetmap.org/directions?engine=osrm_car&route={lat},{lng}&locale={locale}#map={zoom}/{lat}/{lng}", # noqa
|
||||||
'ajax_proxy': '/ajax-proxy/?url={url}&ttl={ttl}',
|
"ajax_proxy": "/ajax-proxy/?url={url}&ttl={ttl}",
|
||||||
'search': 'https://photon.komoot.io/api/?',
|
"search": "https://photon.komoot.io/api/?",
|
||||||
}
|
}
|
||||||
UMAP_KEEP_VERSIONS = env.int('UMAP_KEEP_VERSIONS', default=10)
|
UMAP_KEEP_VERSIONS = env.int("UMAP_KEEP_VERSIONS", default=10)
|
||||||
SITE_URL = env("SITE_URL", default="http://umap.org")
|
SITE_URL = env("SITE_URL", default="http://umap.org")
|
||||||
SHORT_SITE_URL = env('SHORT_SITE_URL', default=None)
|
SHORT_SITE_URL = env("SHORT_SITE_URL", default=None)
|
||||||
SITE_NAME = 'uMap'
|
SITE_NAME = "uMap"
|
||||||
UMAP_DEMO_SITE = env('UMAP_DEMO_SITE', default=False)
|
UMAP_DEMO_SITE = env("UMAP_DEMO_SITE", default=False)
|
||||||
UMAP_EXCLUDE_DEFAULT_MAPS = False
|
UMAP_EXCLUDE_DEFAULT_MAPS = False
|
||||||
UMAP_MAPS_PER_PAGE = 5
|
UMAP_MAPS_PER_PAGE = 5
|
||||||
UMAP_MAPS_PER_SEARCH = 25
|
UMAP_MAPS_PER_SEARCH = 25
|
||||||
UMAP_MAPS_PER_PAGE_OWNER = 10
|
UMAP_MAPS_PER_PAGE_OWNER = 10
|
||||||
UMAP_SEARCH_CONFIGURATION = "simple"
|
UMAP_SEARCH_CONFIGURATION = "simple"
|
||||||
UMAP_FEEDBACK_LINK = "https://wiki.openstreetmap.org/wiki/UMap#Feedback_and_help" # noqa
|
UMAP_FEEDBACK_LINK = (
|
||||||
USER_MAPS_URL = 'user_maps'
|
"https://wiki.openstreetmap.org/wiki/UMap#Feedback_and_help" # noqa
|
||||||
DATABASES = {
|
)
|
||||||
'default': env.db(default='postgis://localhost:5432/umap')
|
USER_MAPS_URL = "user_maps"
|
||||||
}
|
DATABASES = {"default": env.db(default="postgis://localhost:5432/umap")}
|
||||||
UMAP_DEFAULT_SHARE_STATUS = None
|
UMAP_DEFAULT_SHARE_STATUS = None
|
||||||
UMAP_DEFAULT_EDIT_STATUS = None
|
UMAP_DEFAULT_EDIT_STATUS = None
|
||||||
UMAP_DEFAULT_FEATURES_HAVE_OWNERS = False
|
UMAP_DEFAULT_FEATURES_HAVE_OWNERS = False
|
||||||
|
|
||||||
UMAP_READONLY = env('UMAP_READONLY', default=False)
|
UMAP_READONLY = env("UMAP_READONLY", default=False)
|
||||||
UMAP_GZIP = True
|
UMAP_GZIP = True
|
||||||
LOCALE_PATHS = [os.path.join(PROJECT_DIR, 'locale')]
|
LOCALE_PATHS = [os.path.join(PROJECT_DIR, "locale")]
|
||||||
|
|
||||||
LEAFLET_LONGITUDE = env.int('LEAFLET_LONGITUDE', default=2)
|
LEAFLET_LONGITUDE = env.int("LEAFLET_LONGITUDE", default=2)
|
||||||
LEAFLET_LATITUDE = env.int('LEAFLET_LATITUDE', default=51)
|
LEAFLET_LATITUDE = env.int("LEAFLET_LATITUDE", default=51)
|
||||||
LEAFLET_ZOOM = env.int('LEAFLET_ZOOM', default=6)
|
LEAFLET_ZOOM = env.int("LEAFLET_ZOOM", default=6)
|
||||||
|
|
||||||
|
|
||||||
# =============================================================================
|
# =============================================================================
|
||||||
|
@ -272,31 +273,29 @@ SOCIAL_AUTH_LOGIN_REDIRECT_URL = "/login/popup/end/"
|
||||||
|
|
||||||
AUTHENTICATION_BACKENDS = ()
|
AUTHENTICATION_BACKENDS = ()
|
||||||
|
|
||||||
SOCIAL_AUTH_OPENSTREETMAP_KEY = env('SOCIAL_AUTH_OPENSTREETMAP_KEY', default="")
|
SOCIAL_AUTH_OPENSTREETMAP_KEY = env("SOCIAL_AUTH_OPENSTREETMAP_KEY", default="")
|
||||||
SOCIAL_AUTH_OPENSTREETMAP_SECRET = env('SOCIAL_AUTH_OPENSTREETMAP_SECRET', default="")
|
SOCIAL_AUTH_OPENSTREETMAP_SECRET = env("SOCIAL_AUTH_OPENSTREETMAP_SECRET", default="")
|
||||||
if SOCIAL_AUTH_OPENSTREETMAP_KEY and SOCIAL_AUTH_OPENSTREETMAP_SECRET:
|
if SOCIAL_AUTH_OPENSTREETMAP_KEY and SOCIAL_AUTH_OPENSTREETMAP_SECRET:
|
||||||
AUTHENTICATION_BACKENDS += (
|
AUTHENTICATION_BACKENDS += (
|
||||||
'social_core.backends.openstreetmap.OpenStreetMapOAuth',
|
"social_core.backends.openstreetmap.OpenStreetMapOAuth",
|
||||||
)
|
)
|
||||||
|
|
||||||
AUTHENTICATION_BACKENDS += (
|
AUTHENTICATION_BACKENDS += ("django.contrib.auth.backends.ModelBackend",)
|
||||||
'django.contrib.auth.backends.ModelBackend',
|
|
||||||
)
|
|
||||||
|
|
||||||
LOGGING = {
|
LOGGING = {
|
||||||
'version': 1,
|
"version": 1,
|
||||||
'disable_existing_loggers': False,
|
"disable_existing_loggers": False,
|
||||||
'handlers': {
|
"handlers": {
|
||||||
'console': {
|
"console": {
|
||||||
'level': 'ERROR',
|
"level": "ERROR",
|
||||||
'filters': None,
|
"filters": None,
|
||||||
'class': 'logging.StreamHandler',
|
"class": "logging.StreamHandler",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
'loggers': {
|
"loggers": {
|
||||||
'django': {
|
"django": {
|
||||||
'handlers': ['console'],
|
"handlers": ["console"],
|
||||||
'level': 'ERROR',
|
"level": "ERROR",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,16 +1,16 @@
|
||||||
"""Settings for Development Server"""
|
"""Settings for Development Server"""
|
||||||
from umap.settings.base import * # pylint: disable=W0614,W0401
|
from umap.settings.base import * # pylint: disable=W0614,W0401
|
||||||
|
|
||||||
DEBUG = True
|
DEBUG = True
|
||||||
TEMPLATE_DEBUG = DEBUG
|
TEMPLATE_DEBUG = DEBUG
|
||||||
|
|
||||||
VAR_ROOT = '/var/www/umap'
|
VAR_ROOT = "/var/www/umap"
|
||||||
MEDIA_ROOT = os.path.join(VAR_ROOT, 'uploads')
|
MEDIA_ROOT = os.path.join(VAR_ROOT, "uploads")
|
||||||
STATIC_ROOT = os.path.join(VAR_ROOT, 'static')
|
STATIC_ROOT = os.path.join(VAR_ROOT, "static")
|
||||||
|
|
||||||
DATABASES = {
|
DATABASES = {
|
||||||
'default': {
|
"default": {
|
||||||
'ENGINE': 'django.db.backends.postgresql_psycopg2',
|
"ENGINE": "django.db.backends.postgresql_psycopg2",
|
||||||
'NAME': 'umap',
|
"NAME": "umap",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,55 +9,55 @@ your code repository.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from umap.settings.base import * # pylint: disable=W0614,W0401
|
from umap.settings.base import * # pylint: disable=W0614,W0401
|
||||||
|
|
||||||
SECRET_KEY = '!!change me!!'
|
SECRET_KEY = "!!change me!!"
|
||||||
INTERNAL_IPS = ('127.0.0.1', )
|
INTERNAL_IPS = ("127.0.0.1",)
|
||||||
ALLOWED_HOSTS = ['*', ]
|
ALLOWED_HOSTS = [
|
||||||
|
"*",
|
||||||
|
]
|
||||||
|
|
||||||
DEBUG = True
|
DEBUG = True
|
||||||
|
|
||||||
ADMINS = (
|
ADMINS = (("You", "your@email"),)
|
||||||
('You', 'your@email'),
|
|
||||||
)
|
|
||||||
MANAGERS = ADMINS
|
MANAGERS = ADMINS
|
||||||
|
|
||||||
DATABASES = {
|
DATABASES = {
|
||||||
'default': {
|
"default": {
|
||||||
'ENGINE': 'django.contrib.gis.db.backends.postgis',
|
"ENGINE": "django.contrib.gis.db.backends.postgis",
|
||||||
'NAME': 'umap',
|
"NAME": "umap",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
COMPRESS_ENABLED = False
|
COMPRESS_ENABLED = False
|
||||||
COMPRESS_OFFLINE = True
|
COMPRESS_OFFLINE = True
|
||||||
|
|
||||||
LANGUAGE_CODE = 'en'
|
LANGUAGE_CODE = "en"
|
||||||
|
|
||||||
# Set to False if login into django account should not be possible. You can
|
# Set to False if login into django account should not be possible. You can
|
||||||
# administer accounts in the admin interface.
|
# administer accounts in the admin interface.
|
||||||
ENABLE_ACCOUNT_LOGIN = True
|
ENABLE_ACCOUNT_LOGIN = True
|
||||||
|
|
||||||
AUTHENTICATION_BACKENDS = (
|
AUTHENTICATION_BACKENDS = (
|
||||||
'social_core.backends.github.GithubOAuth2',
|
"social_core.backends.github.GithubOAuth2",
|
||||||
'social_core.backends.bitbucket.BitbucketOAuth',
|
"social_core.backends.bitbucket.BitbucketOAuth",
|
||||||
'social_core.backends.twitter.TwitterOAuth',
|
"social_core.backends.twitter.TwitterOAuth",
|
||||||
'social_core.backends.openstreetmap.OpenStreetMapOAuth',
|
"social_core.backends.openstreetmap.OpenStreetMapOAuth",
|
||||||
'django.contrib.auth.backends.ModelBackend',
|
"django.contrib.auth.backends.ModelBackend",
|
||||||
)
|
)
|
||||||
SOCIAL_AUTH_GITHUB_KEY = 'xxx'
|
SOCIAL_AUTH_GITHUB_KEY = "xxx"
|
||||||
SOCIAL_AUTH_GITHUB_SECRET = 'xxx'
|
SOCIAL_AUTH_GITHUB_SECRET = "xxx"
|
||||||
SOCIAL_AUTH_BITBUCKET_KEY = 'xxx'
|
SOCIAL_AUTH_BITBUCKET_KEY = "xxx"
|
||||||
SOCIAL_AUTH_BITBUCKET_SECRET = 'xxx'
|
SOCIAL_AUTH_BITBUCKET_SECRET = "xxx"
|
||||||
# We need email to associate with other Oauth providers
|
# We need email to associate with other Oauth providers
|
||||||
SOCIAL_AUTH_GITHUB_SCOPE = ["user:email", ]
|
SOCIAL_AUTH_GITHUB_SCOPE = [
|
||||||
|
"user:email",
|
||||||
|
]
|
||||||
SOCIAL_AUTH_TWITTER_KEY = "xxx"
|
SOCIAL_AUTH_TWITTER_KEY = "xxx"
|
||||||
SOCIAL_AUTH_TWITTER_SECRET = "xxx"
|
SOCIAL_AUTH_TWITTER_SECRET = "xxx"
|
||||||
SOCIAL_AUTH_OPENSTREETMAP_KEY = 'xxx'
|
SOCIAL_AUTH_OPENSTREETMAP_KEY = "xxx"
|
||||||
SOCIAL_AUTH_OPENSTREETMAP_SECRET = 'xxx'
|
SOCIAL_AUTH_OPENSTREETMAP_SECRET = "xxx"
|
||||||
MIDDLEWARE += (
|
MIDDLEWARE += ("social_django.middleware.SocialAuthExceptionMiddleware",)
|
||||||
'social_django.middleware.SocialAuthExceptionMiddleware',
|
|
||||||
)
|
|
||||||
SOCIAL_AUTH_REDIRECT_IS_HTTPS = True
|
SOCIAL_AUTH_REDIRECT_IS_HTTPS = True
|
||||||
SOCIAL_AUTH_RAISE_EXCEPTIONS = False
|
SOCIAL_AUTH_RAISE_EXCEPTIONS = False
|
||||||
SOCIAL_AUTH_BACKEND_ERROR_URL = "/"
|
SOCIAL_AUTH_BACKEND_ERROR_URL = "/"
|
||||||
|
@ -94,17 +94,17 @@ SHORT_SITE_URL = "http://s.hort"
|
||||||
# }
|
# }
|
||||||
|
|
||||||
# POSTGIS_VERSION = (2, 1, 0)
|
# POSTGIS_VERSION = (2, 1, 0)
|
||||||
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
|
EMAIL_BACKEND = "django.core.mail.backends.console.EmailBackend"
|
||||||
|
|
||||||
# Put the site in readonly mode (useful for migration or any maintenance)
|
# Put the site in readonly mode (useful for migration or any maintenance)
|
||||||
UMAP_READONLY = False
|
UMAP_READONLY = False
|
||||||
|
|
||||||
|
|
||||||
# For static deployment
|
# For static deployment
|
||||||
STATIC_ROOT = '/srv/umap/var/static'
|
STATIC_ROOT = "/srv/umap/var/static"
|
||||||
|
|
||||||
# For users' statics (geojson mainly)
|
# For users' statics (geojson mainly)
|
||||||
MEDIA_ROOT = '/srv/umap/var/data'
|
MEDIA_ROOT = "/srv/umap/var/data"
|
||||||
|
|
||||||
# Default map location for new maps
|
# Default map location for new maps
|
||||||
LEAFLET_LONGITUDE = 2
|
LEAFLET_LONGITUDE = 2
|
||||||
|
|
Loading…
Reference in a new issue