Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rosetta external commands #163

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions rosetta/conf/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
"""
WSGI_AUTO_RELOAD = getattr(settings, 'ROSETTA_WSGI_AUTO_RELOAD', False)
UWSGI_AUTO_RELOAD = getattr(settings, 'ROSETTA_UWSGI_AUTO_RELOAD', False)
ROSETTA_EXTERNAL_COMMANDS = getattr(settings, 'ROSETTA_EXTERNAL_COMMANDS', False)


# Exclude applications defined in this list from being translated
Expand Down
8 changes: 8 additions & 0 deletions rosetta/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,14 @@ def _request_request(key, default=None):
except:
# we may not be running under uwsgi :P
pass

if rosetta_settings.ROSETTA_EXTERNAL_COMMANDS:
try:
from subprocess import call
for command in rosetta_settings.ROSETTA_EXTERNAL_COMMANDS:
call(command)
except:
pass

except Exception as e:
messages.error(request, e)
Expand Down