This is a simple app that can be used to bring down a PyPE django project by simply adding an entry to an oracle table.
To include this app in your PyPE project, simply pull it into your project via svn:externals.
path: extra/outage
URL: https://github.com/UT-Austin-FIS/outage/tags/1.2/outage
- Add "outage" to your INSTALLED_APPS setting like this::
INSTALLED_APPS = (
...
'outage',
)
- Add the outage middleware to your MIDDLEWARE_CLASSES setting like this::
MIDDLEWARE_CLASSES= (
...
'outage.middleware.OutageMiddleware',
)
- Add an OUTAGE_CONTEXT object to your settings.py. This should be a class that carries the core of your page context logic. If not supplied, the UTDirectContext will be used, but you will need to supply the api key in your settings (eg: API_KEY = 'your_api_key')::
OUTAGE_CONTEXT = 'path.to.your.desired.context.object'
- Add an OUTAGE_DEFAULT_REDIRECT to your settings.py. This should be the name url pattern, and will be used to redirect any users attempting to access the outage urls directly, when there is no outage occuring.::
OUTAGE_DEFAULT_REDIRECT = 'url_name' # e.g.: 'home'
- Include the outage URLconf in your project urls.py like this::
url(r'^apps/services/requests/', include(outage.urls)),
- Run
python manage.py syncdb
to create the outage models.
NOTE: Since this app creates a new table, if your database design involves multiple users, you will need to go through the same process that you typically use to migrate a table and grant privileges.