-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from onaio/issue-6
Add support for python statements in settings file
- Loading branch information
Showing
3 changed files
with
22 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -93,6 +93,11 @@ django_settings: | |
DEFAULT_FROM_EMAIL: "'Hello World <[email protected]>'" | ||
ALLOWED_HOSTS: "[]" | ||
DEBUG: True | ||
## python statements included at the top of settings file | ||
top_python_statements: | ||
- import os | ||
## python statements included at the bottom of settings file | ||
bottom_python_statements: | ||
|
||
# wsgi | ||
wsgi_module: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,15 @@ | ||
import os | ||
{% if top_python_statements %} | ||
{% for stmt in top_python_statements %} | ||
{{ stmt }} | ||
{% endfor %} | ||
{% endif %} | ||
|
||
{% for k,v in django_settings.items() %} | ||
{{k}} = {{v}} | ||
{% endfor %} | ||
{% endfor %} | ||
|
||
{% if bottom_python_statements %} | ||
{% for stmt in bottom_python_statements %} | ||
{{ stmt }} | ||
{% endfor %} | ||
{% endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters