Пример #1
0
"""
Django settings for djambda project.
"""

import environs

# Read env variables
# https://github.com/sloria/environs
env = environs.Env()

# Build paths inside the project like this: BASE_DIR / '...'
BASE_DIR = env.path("BASE_DIR",
                    default=str(environs.Path(__file__).parents[1]))

# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/3.1/howto/deployment/checklist/

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = env.str(
    "SECRET_KEY", default="ia_66li-_2c)n73kvp^)f)3$r@2kg!glphw4c3%yj3-@s1f70m")

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = env.bool("DEBUG", default=True)

ALLOWED_HOSTS = env.list("ALLOWED_HOSTS", default=[])

# Application definition

INSTALLED_APPS = [
    "django.contrib.admin",
    "django.contrib.auth",
Пример #2
0
import os

import environs

env = environs.Env()

BASE_DIR = environs.Path(__file__).parent.parent

TEMPLATE_ROOT = BASE_DIR.joinpath("templates", "bootstrap4")

DEBUG = env.bool("DJANGO_DEBUG", default=False)

ADMINS = ()

MANAGERS = ADMINS

TIME_ZONE = "America/Chicago"

LANGUAGE_CODE = "en-us"

SITE_ID = 1

USE_I18N = True
USE_L10N = True

USE_ETAGS = True

TIME_ZONE = "America/Chicago"
LANGUAGE_CODE = "en-us"

DATABASES = {
Пример #3
0
import os
import socket
import sys

import environs

from apps.base.utils.env import env

BASE_DIR = environs.Path(__file__).parent.parent  # type: ignore

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

if READ_DOT_ENV_FILE is True:
    env.read_env(str(BASE_DIR.joinpath(".env")))

# 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 = env("SECRET_KEY")

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = env.bool("DEBUG", default=False)

ALLOWED_HOSTS = env.list("ALLOWED_HOSTS", default=[])
INTERNAL_IPS = env.list("INTERNAL_IPS", default=["127.0.0.1"])

# Get the IP to use for Django Debug Toolbar when developing with docker
ip = socket.gethostbyname(socket.gethostname())
INTERNAL_IPS += [ip[:-1] + "1"]
Пример #4
0
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 environs

# Read env variables
# https://github.com/sloria/environs
env = environs.Env()


# Build paths inside the project like this: BASE_DIR / '...'
BASE_DIR = env.path("BASE_DIR", default=str(environs.Path(__file__).parents[1]))


# 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 = env.str(
    "SECRET_KEY", default="m^+#mk0p@w-5tmk#4g(b3)s)#6nvh*#kry%re3snsuad+%h%d!"
)

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = env.bool("DEBUG", default=True)

ALLOWED_HOSTS = env.list("ALLOWED_HOSTS", default=[])
Пример #5
0
from typing import Tuple, Sequence
import environs
from sqlalchemy.ext.automap import automap_base
from sqlalchemy.orm import Session
from sqlalchemy import create_engine

# Reading local environment variables
ROOT_DIR = environs.Path(__file__).parents[2]
env = environs.Env()
env.read_env(str(ROOT_DIR / ".env"))

# Database initialisation
db_uri = env("MIMIC_DB_URI")
db = create_engine(db_uri)
Base = automap_base()
Base.prepare(engine=db, reflect=True, schema="mimiciii")

CareGiver = Base.classes.caregivers
Admission = Base.classes.admissions
Patient = Base.classes.patients
Item = Base.classes.d_items
DTEvent = Base.classes.datetimeevents
ProcedureEvent = Base.classes.procedureevents_mv
ProcedureICD = Base.classes.procedures_icd
Transfer = Base.classes.transfers
AdmDRGCode = Base.classes.drgcodes
AdmICDCode = Base.classes.diagnoses_icd
ICDDiagnose = Base.classes.d_icd_diagnoses
ICDProcedure = Base.classes.d_icd_procedures

Пример #6
0
import environs

# env vars assignment
env = environs.Env()
environs.Env.read_env()

# project root
root = environs.Path(__file__).parents[1]

# heroku
HEROKU_APP_NAME = env("HEROKU_APP_NAME")

# tradeX
USER_LOGIN = env("USER_LOGIN")
USER_PASS = env("USER_PASS")
USER_WMID = env("USER_WMID")

# db
DATABASE_URL = env("DATABASE_URL")

# binance
BINANCE_APIKEY = env("BINANCE_APIKEY")
BINANCE_SECRETKEY = env("BINANCE_SECRETKEY")