-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7fde739
commit a4b6ede
Showing
180 changed files
with
6,177 additions
and
18,811 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,8 @@ DJANGO_SECRET_KEY= | |
PROJECT_FULL_NAME=gigamaps | ||
PROJECT_SHORT_NAME=gigamaps | ||
|
||
GIGAMAPS_LOG_LEVEL = DEBUG | ||
|
||
[email protected] | ||
SUPPORT_PHONE_NUMBER=1234567890 | ||
|
||
|
@@ -60,7 +62,6 @@ CACHE_CONTROL_MAX_AGE_FOR_FE=14400 | |
|
||
API_KEY_ADMIN_DASHBOARD_URL=http://localhost:9500/admin/api-keys | ||
|
||
|
||
EMAIL_URL= | ||
SERVER_EMAIL_SIGNATURE=Gigamaps | ||
[email protected] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/usr/bin/env bash | ||
set -ex | ||
|
||
# export environment variables to make them available in ssh session | ||
for var in $(compgen -e); do | ||
echo "export $var=${!var}" >> /etc/profile | ||
done | ||
|
||
export FLASK_APP=hello.py | ||
pipenv run python -m flask run --host 0.0.0.0 --port 8000 & | ||
|
||
if $ENABLED_FLOWER_METRICS; then | ||
echo "Starting worker ..." | ||
pipenv run celery --app=proco.taskapp worker --concurrency=2 --time-limit=300 --soft-time-limit=300 $* & | ||
|
||
echo "Starting flower ..." | ||
pipenv run celery --app=proco.taskapp flower | ||
else | ||
echo "Starting worker ..." | ||
pipenv run celery --app=proco.taskapp worker --concurrency=2 --time-limit=300 --soft-time-limit=300 $* | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
import json | ||
import os | ||
import sys | ||
import warnings | ||
|
||
import environ | ||
|
@@ -34,7 +37,7 @@ | |
# -------------------------------------------------------------------------- | ||
|
||
DJANGO_APPS = [ | ||
'config.apps.CustomAdminConfig', | ||
'django.contrib.admin', | ||
'django.contrib.auth', | ||
'django.contrib.contenttypes', | ||
'django.contrib.sessions', | ||
|
@@ -73,12 +76,9 @@ | |
'proco.locations', | ||
'proco.connection_statistics', | ||
'proco.contact', | ||
'proco.dailycheckapp_contact', | ||
'proco.background', | ||
'proco.realtime_unicef', | ||
'proco.realtime_dailycheckapp', | ||
'proco.proco_data_migrations', | ||
'proco.data_sources' | ||
'proco.data_sources', | ||
] | ||
|
||
INSTALLED_APPS = DJANGO_APPS + THIRD_PARTY_APPS + LOCAL_APPS | ||
|
@@ -342,15 +342,13 @@ | |
'schools', | ||
'background', | ||
'contact', | ||
'dailycheckapp_contact', | ||
'accounts', | ||
'data_sources', | ||
) | ||
|
||
RANDOM_SCHOOLS_DEFAULT_AMOUNT = env('RANDOM_SCHOOLS_DEFAULT_AMOUNT', default=20000) | ||
|
||
CONTACT_MANAGERS = env.list('CONTACT_MANAGERS', default=['[email protected]']) | ||
DAILYCHECKAPP_CONTACT_MANAGERS = env.list('DAILYCHECKAPP_CONTACT_MANAGERS', default=['[email protected]']) | ||
|
||
CONSTANCE_REDIS_CONNECTION = env('REDIS_URL', default='redis://localhost:6379/0') | ||
CONSTANCE_ADDITIONAL_FIELDS = { | ||
|
@@ -361,7 +359,6 @@ | |
} | ||
CONSTANCE_CONFIG = { | ||
'CONTACT_EMAIL': (env('CONTACT_EMAIL', default=''), 'Email to receive contact messages', 'email_input'), | ||
'DAILYCHECKAPP_CONTACT_EMAIL': ('', 'Email to receive dailycheckapp_contact messages', 'email_input'), | ||
} | ||
|
||
# Cache control headers | ||
|
@@ -436,4 +433,48 @@ | |
|
||
INVALIDATE_CACHE_HARD = env('INVALIDATE_CACHE_HARD', default='false') | ||
|
||
with open(os.path.join(BASE_DIR, 'proco', 'core', 'resources', 'filters.json')) as filters_json_file: | ||
FILTERS_DATA = json.load(filters_json_file) | ||
|
||
# DATABASE_ROUTERS = ["proco.utils.read_db_router.StandbyRouter"] | ||
|
||
GIGAMAPS_LOG_LEVEL = env('GIGAMAPS_LOG_LEVEL', default='INFO') | ||
|
||
# LOGGING | ||
LOGGING = { | ||
'version': 1, | ||
'disable_existing_loggers': False, | ||
'filters': { | ||
'require_debug_false': { | ||
'()': 'django.utils.log.RequireDebugFalse', | ||
}, | ||
'require_debug_true': { | ||
'()': 'django.utils.log.RequireDebugTrue', | ||
}, | ||
'hostname_filter': { | ||
'()': 'proco.core.filters.HostInfoFilter', | ||
}, | ||
}, | ||
'formatters': { | ||
'verbose': { | ||
'format': '%(hostname)s %(hostip)s %(asctime)s %(levelname)s %(pathname)s %(process)d ' | ||
'%(processName)s %(thread)d: %(message)s' | ||
}, | ||
}, | ||
'handlers': { | ||
'console': { | ||
'level': GIGAMAPS_LOG_LEVEL, | ||
'class': 'logging.StreamHandler', | ||
'formatter': 'verbose', | ||
'stream': sys.stderr, | ||
'filters': ['hostname_filter'], | ||
}, | ||
}, | ||
'loggers': { | ||
'gigamaps': { | ||
'level': GIGAMAPS_LOG_LEVEL, | ||
'handlers': ['console'], | ||
'filters': ['hostname_filter'], | ||
}, | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
from kombu import Exchange, Queue # NOQA | ||
|
||
from config.settings.base import * # noqa: F403 | ||
|
||
# Pytest speed improvements configuration | ||
# Disable debugging for test case execution | ||
DEBUG = False | ||
TEMPLATES[0]['OPTIONS']['debug'] = DEBUG | ||
|
||
SECRET_KEY = env('SECRET_KEY', default='test_key') | ||
|
||
ALLOWED_HOSTS = ['*'] | ||
INTERNAL_IPS = [] | ||
|
||
ADMINS = ( | ||
('Dev Email', env('DEV_ADMIN_EMAIL', default='admin@localhost')), | ||
) | ||
MANAGERS = ADMINS | ||
|
||
|
||
# Database | ||
# https://docs.djangoproject.com/en/1.9/ref/settings/#databases | ||
# -------------------------------------------------------------------------- | ||
|
||
DATABASES = { | ||
'default': env.db(default='postgis://localhost/proco'), | ||
} | ||
|
||
DATABASES['default']['CONN_MAX_AGE'] = 1000 | ||
|
||
# Email settings | ||
# -------------------------------------------------------------------------- | ||
|
||
# DEFAULT_FROM_EMAIL = '[email protected]' | ||
# SERVER_EMAIL = DEFAULT_FROM_EMAIL | ||
# EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend' | ||
|
||
if CELERY_ENABLED: | ||
MAILING_USE_CELERY = False | ||
|
||
INTERNAL_IPS = ('127.0.0.1',) | ||
|
||
# Sentry config | ||
# ------------- | ||
|
||
SENTRY_ENABLED = False | ||
|
||
|
||
# Mapbox | ||
# -------------- | ||
|
||
MAPBOX_KEY = env('MAPBOX_KEY', default='') | ||
|
||
ANYMAIL['DEBUG_API_REQUESTS'] = False | ||
|
||
ENABLE_AZURE_COGNITIVE_SEARCH = False | ||
|
||
AZURE_CONFIG['COGNITIVE_SEARCH'] = { | ||
'SEARCH_ENDPOINT': env('SEARCH_ENDPOINT', default='test.endpoint'), | ||
'SEARCH_API_KEY': env('SEARCH_API_KEY', default='testsearchapikey'), | ||
'COUNTRY_INDEX_NAME': env('COUNTRY_INDEX_NAME', default='giga_countries'), | ||
'SCHOOL_INDEX_NAME': env('SCHOOL_INDEX_NAME', default='giga_schools'), | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Oops, something went wrong.