Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
I
Ilens-Env-Settings
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
CI / CD Analytics
Repository Analytics
Value Stream Analytics
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Irfanuddin
Ilens-Env-Settings
Commits
9b7632fe
Commit
9b7632fe
authored
Mar 09, 2021
by
Irfanuddin
🚴🏽
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
docs: Added samples
parent
98f0ee66
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
46 additions
and
2 deletions
+46
-2
.gitignore
.gitignore
+0
-1
README.md
README.md
+12
-0
assets/.env
assets/.env
+33
-0
ilens_env_settings/__init__.py
ilens_env_settings/__init__.py
+1
-1
No files found.
.gitignore
View file @
9b7632fe
...
...
@@ -482,7 +482,6 @@ celerybeat.pid
*.sage.py
# Environments
.env
env/
venv/
ENV/
...
...
README.md
View file @
9b7632fe
...
...
@@ -15,3 +15,15 @@ env_settings_local = get_env_settings(use_local=True)
# to load from local .env at different location
env_settings_local_other
=
get_env_settings
(
use_local
=
True
,
env_file
=
'<path_to_file>'
)
```
`get_env_settings`
returns a class object containing all the required environment variables.
To access an environment variable
```
python
app_env
=
env_settings
.
APP_ENV
# to get all as a dictionary
env_settings
.
dict
()
```
Sample
`.env`
file:
assets/.env
0 → 100644
View file @
9b7632fe
#ENV
APP_ENV=PROD
#Mongo
MONGO_URI=mongodb://[username:password@]host1[:port1][,...hostN[:portN]][/[defaultauthdb][?options]]
#Kairos
KAIROS_URI=
#MQTT
MQTT_HOST=
MQTT_PORT=1883
MQTT_AUTH=
MQTT_USERNAME =
MQTT_PASSWORD =
#KAFKA
KAFKA_HOST=
KAFKA_PORT=
#REDIS
REDIS_HOST=
REDIS_PORT=
# Postgres Details
POSTGRES_URI=
#OTHERSERVICES
BASE_PROXY=
SECURITY_IP_CHECK=False
SECURITY_USER_CHECK=True
SECURITY_AGENT_CHECK=True
ilens_env_settings/__init__.py
View file @
9b7632fe
...
...
@@ -45,7 +45,7 @@ class EnvironmentSettings(BaseSettings):
POSTGRES_URI
:
Optional
[
str
]
# Base Proxy for all services
BASE_PROXY
:
str
BASE_PROXY
:
Optional
[
str
]
# Security aspects
SECURITY_IP_CHECK
:
bool
=
True
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment