Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#389: Make Android app packageId configurable via settings value
- Loading branch information
Showing
5 changed files
with
39 additions
and
6 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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
from django import template | ||
from django.conf import settings | ||
|
||
register = template.Library() | ||
|
||
ALLOWABLE_VALUES = ("OPPIA_ANDROID_PACKAGEID", "OPPIA_ANDROID_ON_GOOGLE_PLAY", "OPPIA_ANDROID_DEFAULT_PACKAGEID", "BASESITE_URL", "OPPIA_MAX_UPLOAD_SIZE") | ||
|
||
# settings value (based on https://stackoverflow.com/a/21593607) | ||
@register.simple_tag | ||
def settings_value(name): | ||
if name in ALLOWABLE_VALUES: | ||
return getattr(settings, name, '') | ||
return '' |
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
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
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
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