import dj_database_url from decouple import Csv, config # Build paths inside the project like this: os.path.join(BASE_DIR, ...) BASE_DIR = os.path.dirname(os.path.dirname(__file__)) # Quick-start development settings - unsuitable for production # See https://docs.djangoproject.com/en/1.7/howto/deployment/checklist/ # SECURITY WARNING: keep the secret key used in production secret! SECRET_KEY = config('SECRET_KEY') # SECURITY WARNING: don't run with debug turned on in production! DEBUG = config('DEBUG', cast=bool) ALLOWED_HOSTS = config('ALLOWED_HOSTS', cast=Csv()) # Application definition INSTALLED_APPS = [ # Project specific apps 'feedthefox.base', 'feedthefox.users', 'feedthefox.dashboard', 'feedthefox.devices', # Third party apps 'django_jinja', 'storages', # Django apps
# Build paths inside the project like this: os.path.join(BASE_DIR, ...) BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) # SECURITY WARNING: keep the secret key used in production secret! SECRET_KEY = config("SECRET_KEY") # SECURITY WARNING: don't run with debug turned on in production! DEBUG = config("DEBUG", default=False, cast=bool) # NOTE(prmtl): API & managment panel can be on different domain than URLs SHORT_URL_DOMAIN_NAME = config("SHORT_URL_DOMAIN_NAME", default="tier.app") SHORT_URL_SCHEME = config("SHORT_URL_SCHEME", default="http") DOMAIN_NAME = config("DOMAIN_NAME", default="localhost") ADDITIONAL_ALLOWED_HOSTS = config("ADDITIONAL_ALLOWED_HOSTS", cast=Csv()) ALLOWED_HOSTS = [DOMAIN_NAME, SHORT_URL_DOMAIN_NAME] + ADDITIONAL_ALLOWED_HOSTS # Application definition INSTALLED_APPS = [ "server.apps.AdminConfig", # django "django.contrib.auth", "django.contrib.contenttypes", "django.contrib.sessions", "django.contrib.messages", "django.contrib.staticfiles", # local "server.core", "server.api",
CHUNK_SIZE = 1024 * 256 # 256 KB MAX_CSV_DOWNLOAD_AGE = 60 * 60 * 24 * 2 # two days INITIALIZE_SERVER = config('INITIALIZE_SERVER', default=True, cast=bool) # Minimum number of hours old an entry in the CSV files need to be # to NOT be skipped. MIN_AGE_LAST_MODIFIED_HOURS = config('MIN_AGE_LAST_MODIFIED_HOURS', default=0, cast=int) CSV_DOWNLOAD_DIRECTORY = config('CSV_DOWNLOAD_DIRECTORY', default=tempfile.gettempdir()) INVENTORIES = tuple( config('INVENTORIES', default='firefox, archive', cast=Csv())) LOG_LEVEL = config('LOG_LEVEL', default='INFO') STORE_DAILY_MANIFEST = config('STORE_DAILY_MANIFEST', default=False, cast=bool) # Optional Sentry with synchronuous client. SENTRY_DSN = config('SENTRY_DSN', default=None) sentry = raven.Client( SENTRY_DSN, transport=raven.transport.http.HTTPTransport, release=__version__, ) logger = logging.getLogger() # root logger. metrics = get_metrics('buildhub')
LDAP_URI = config('LDAP_URI', default=None) LDAP_USERDN = config('LDAP_BINDDN', default=None) LDAP_PASSWD = config('LDAP_PASSWD', default=None) LDAP_SEARCH_BASE = config('LDAP_SEARCH_BASE', default="dc=georchestra,dc=org") LDAP_SEARCH_FILTER = config('LDAP_SEARCH_FILTER', default="(objectClass=person)") MAPPED_REMOTE_FIELDS = { 'first_name': 'givenName', 'last_name': 'sn', 'username': '******', 'email': 'mail', 'member_of': 'memberOf', } PROTECTED_USER_NAMES = config('PROTECTED_USER_NAMES', default='', cast=Csv()) EXCLUDED_USER_NAMES = config('EXCLUDED_USER_NAMES', default='', cast=Csv()) ADMIN_USER_GROUPS = config( 'ADMIN_USER_GROUPS', default= 'cn=SUPERUSER,ou=roles,dc=georchestra,dc=org;cn=ADMINISTRATOR,ou=roles,dc=georchestra,dc=org', cast=Csv(delimiter=';')) EXCLUSIVE_USER_GROUPS = config('EXCLUSIVE_USER_GROUPS', default='', cast=Csv(delimiter=';')) EXCLUDED_USER_GROUPS = config('EXCLUDED_USER_GROUPS', default='', cast=Csv(delimiter=';')) User = get_user_model()
# Absolute path to the directory that holds media. MEDIA_ROOT = path('media') # URL that handles the media served from MEDIA_ROOT. Make sure to use a # trailing slash if there is a path component (optional in other cases). MEDIA_URL = '/media/' # Absolute path to the directory static files should be collected to. STATIC_ROOT = config('STATIC_ROOT', path('static')) # URL prefix for static files STATIC_URL = '/static/' ALLOWED_HOSTS = config('ALLOWED_HOSTS', '', cast=Csv()) # Defines the views served for root URLs. ROOT_URLCONF = 'crashstats.urls' INSTALLED_APPS = ( 'pipeline', 'django.contrib.contenttypes', 'django.contrib.auth', 'django.contrib.sessions', 'django.contrib.staticfiles', 'django_nose', 'session_csrf', # Application base, containing global templates.
import os from decouple import config, Csv # Build paths inside the project like this: os.path.join(BASE_DIR, ...) BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) # SECURITY WARNING: keep the secret key used in production secret! SECRET_KEY = config('SECRET_KEY', default="SECRET_KEY") # SECURITY WARNING: don't run with debug turned on in production! DEBUG = config('DEBUG', default=True, cast=bool) ALLOWED_HOSTS = config('ALLOWED_HOSTS', default='localhost, 127.0.0.1, 0.0.0.0', cast=Csv()) CSRF_TRUSTED_ORIGINS = list( set(ALLOWED_HOSTS) - set(['localhost', '127.0.0.1', '0.0.0.0'])) USE_X_FORWARDED_HOST = config('USE_X_FORWARDED_HOST', default=False, cast=bool) # Application definition CORE_APPS = [ 'django.contrib.sites', 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'django.contrib.gis',
# Build paths inside the project like this: os.path.join(BASE_DIR, ...) # BASE_DIR was used in original project: 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.1/howto/deployment/checklist/ # SECURITY WARNING: keep the secret key used in production secret! SECRET_KEY = config('SECRET_KEY') # SECURITY WARNING: don't run with debug turned on in production! DEBUG = config('DEBUG', cast=bool) ALLOWED_HOSTS = config('ALLOWED_HOSTS', cast=Csv()) # currently returns ['localhost,127.0.0.1'] startup = 0 while startup < 1: print(ALLOWED_HOSTS) startup += 1 CORS_ORIGIN_ALLOW_ALL = True # Application definition INSTALLED_APPS = [ 'rest_framework', 'rest_framework.authtoken', 'notes', 'django.contrib.admin', 'django.contrib.auth',
import raven from decouple import Csv, config from dj_database_url import parse as db_url BASE_DIR = os.path.dirname(os.path.dirname(__file__)) # Quick-start development settings - unsuitable for production # See https://docs.djangoproject.com/en/dev/howto/deployment/checklist/ # SECURITY WARNING: keep the secret key used in production secret! SECRET_KEY = config('SECRET_KEY') # SECURITY WARNING: don't run with debug turned on in production! DEBUG = config('DEBUG', default=False, cast=bool) INTERNAL_IPS = config('INTERNAL_IPS', default='', cast=Csv()) ALLOWED_HOSTS = config('ALLOWED_HOSTS', default='', cast=Csv()) # Application definition DJANGO_APPS = ( 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.sites', 'django.contrib.staticfiles', 'django.contrib.sitemaps', )
from decouple import config, Csv FLOWER_BROKER_API = config('FLOWER_BROKER_API', default='', cast=str) FLOWER_PORT = config('FLOWER_PORT', default=5555, cast=int) FLOWER_BASIC_AUTH = config('FLOWER_BASIC_AUTH', default='', cast=Csv()) FLOWER_MAX_WORKERS = config('FLOWER_MAX_WORKERS', default=5000, cast=int) FLOWER_MAX_TASKS = config('FLOWER_MAX_TASKS', default=10000, cast=int) FLOWER_PERSISTENT = config('FLOWER_PERSISTENT', default=False, cast=bool) FLOWER_DEBUG = config('FLOWER_DEBUG', default=False, cast=bool) FLOWER_DB = config('FLOWER_DB', default='flower.db', cast=str) # https://flower.readthedocs.io/en/latest/config.html # https://flower.readthedocs.io/en/latest/man.html # https://www.cloudamqp.com/docs/celery.html # RabbitMQ management api broker_api = FLOWER_BROKER_API port = FLOWER_PORT basic_auth = FLOWER_BASIC_AUTH max_workers = FLOWER_MAX_WORKERS max_tasks = FLOWER_MAX_TASKS persistent = FLOWER_PERSISTENT debug = FLOWER_DEBUG db = FLOWER_DB # logging = 'INFO' ''' Ejecutar flower indicando las opciones en commando $ flower --broker=amqp://guest:guest@localhost:5672/ --port=5555 --basic_auth=admin:12345678 --broker=amqp://guest:guest@localhost:5672/ --port=5555 --basic_auth=admin:12345678