from config import PAY_CHANNELS from marketer.config import PHONE_CODE_STATUS, AREA_STATUS_CODE, \ UNIONID_LIMIT, MAX_REQUEST_ONE_DAY, ALIPAY_VERIFY_TRANSFER_AMOUNT from marketer.model_manager import AreaModelManager from marketer.serializers.account import MarketerWithdrawSerializer from marketer.serializers.marketer import CreateMarketerBaseSerializer, \ UpdateMarketerSerializer from marketer.serializers.nested_serializers import MarketerLoginSerializer from marketer.utils.auth import MarketerRegisterAuthentication, \ MarketerAuthentication from marketer.utils.redis_utils import RedisUtil ENV = dynasettings.ENV dynasettings.configure() dynasettings.namespace('PAYUNION') app_id = dynasettings.SUBSCRIPTION_ACCOUNT_APP_ID_MARKETER if ENV != 'dev' else dynasettings.SUBSCRIPTION_ACCOUNT_APP_ID_USER app_secret = dynasettings.SUBSCRIPTION_ACCOUNT_SECRET_MARKETER if ENV != 'dev' else dynasettings.SUBSCRIPTION_ACCOUNT_SECRET_USER logger = logging.getLogger(__file__) class MarketerLoginView(views.APIView): """ 登陆 """ def post(self, request): serializer = MarketerLoginSerializer(data=request.data) serializer.is_valid(raise_exception=True) return Response(status=status.HTTP_200_OK, data=dict(token=serializer.token))
# or run $ source env.sh # print all values in dynaconf: namespace of yaml file print(settings.HOST) print(settings.PORT) print(settings.USERNAME) print(settings.PASSWORD) print(settings.LEVELS) print(settings.TEST_LOADERS) print(settings.MONEY) print(settings.AGE) print(settings.ENABLED) # using development: namespace values for context with settings.using_namespace('DEVELOPMENT'): print(settings.ENVIRONMENT) print(settings.HOST) # back to default dynaconf: namespace print(settings.get('ENVIRONMENT')) print(settings.HOST) # set namespace to development: settings.namespace('development') print(settings.HOST) print(settings.ENVIRONMENT) # back to default namespace again settings.namespace() print(settings.HOST) print(settings.get('ENVIRONMENT'))
print("INIVAR", settings.INIVAR) print("JSONVAR", settings.JSONVAR) print("store:", settings.store) print("loaders:", settings.loaded_by_loaders) print("deleted:", settings._deleted) print("dotenv_override:", settings.DOTENV_OVERRIDE_FOR_DYNACONF) print("redis:", settings.REDIS_FOR_DYNACONF) print("PYVAR", settings.PYVAR) print("YAMLVAR", settings.YAMLVAR) print("TOMLVAR", settings.TOMLVAR) print("INIVAR", settings.INIVAR) print("JSONVAR", settings.JSONVAR) settings.namespace('dev') print("PYVAR", settings.PYVAR) print("YAMLVAR", settings.YAMLVAR) print("TOMLVAR", settings.TOMLVAR) print("INIVAR", settings.INIVAR) print("JSONVAR", settings.JSONVAR) print("store:", settings.store) print("loaders:", settings.loaded_by_loaders) print("deleted:", settings._deleted) print("dotenv_override:", settings.DOTENV_OVERRIDE_FOR_DYNACONF) print("redis:", settings.REDIS_FOR_DYNACONF) settings.namespace() print("PYVAR", settings.PYVAR) print("YAMLVAR", settings.YAMLVAR) print("TOMLVAR", settings.TOMLVAR)