From 97128f1d7d118095da553f31cd9bd33df06216d6 Mon Sep 17 00:00:00 2001 From: mwanjajoel Date: Tue, 18 Feb 2020 18:55:03 +0300 Subject: [PATCH 1/2] bumped up the version --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index ec63a08..5cf0b53 100644 --- a/setup.py +++ b/setup.py @@ -10,7 +10,7 @@ # This does all the work once called setup( name="django-momoapi", - version="1.0.0", + version="1.1.0", description="This is a Django package for the MTN MoMo API.", long_description=README, long_description_content_type="text/markdown", From aafeeda9163b46ff55f75bd0e4b14d20b0aeae15 Mon Sep 17 00:00:00 2001 From: arthurarty Date: Sat, 22 Feb 2020 12:41:52 +0300 Subject: [PATCH 2/2] ch(env-variables) - Introduce use of env variables - Create .env_example. - Move env variables from settings.py to .env file. - Install python-dotenv. --- .env_example | 2 ++ djangomomoapi/settings.py | 7 +++++-- requirements.txt | 1 + 3 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 .env_example diff --git a/.env_example b/.env_example new file mode 100644 index 0000000..73f9ee8 --- /dev/null +++ b/.env_example @@ -0,0 +1,2 @@ +SECRET_KEY= # SECRET_KEY +DEBUG= #true for development dont sent in production \ No newline at end of file diff --git a/djangomomoapi/settings.py b/djangomomoapi/settings.py index f812341..0dec348 100644 --- a/djangomomoapi/settings.py +++ b/djangomomoapi/settings.py @@ -12,6 +12,9 @@ import os +from dotenv import load_dotenv + +load_dotenv() # Build paths inside the project like this: os.path.join(BASE_DIR, ...) BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) @@ -20,10 +23,10 @@ # See https://docs.djangoproject.com/en/2.2/howto/deployment/checklist/ # SECURITY WARNING: keep the secret key used in production secret! -SECRET_KEY = 'ld0%x$9gjq3c#05d5*#0o*e%kdi&@d02(hcjs+hrahs38*6p%(' +SECRET_KEY = os.getenv('SECRET_KEY') # SECURITY WARNING: don't run with debug turned on in production! -DEBUG = True +DEBUG = os.getenv('DEBUG') ALLOWED_HOSTS = [] diff --git a/requirements.txt b/requirements.txt index 00eebc0..9829617 100644 --- a/requirements.txt +++ b/requirements.txt @@ -12,6 +12,7 @@ keyring==21.1.0 pkginfo==1.5.0.1 pycodestyle==2.5.0 Pygments==2.5.2 +python-dotenv==0.11.0 pytz==2019.3 readme-renderer==24.0 requests==2.22.0