GithubHelp home page GithubHelp logo

shutdown's Introduction

Shutdown: A Django App To Shut Down Your Django App

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.

Usage

To include this app in your PyPE project, simply pull it into your project via svn:externals.

path: extra/shutdown

URL: https://github.com/UT-Austin-FIS/shutdown/tags/v1.1.0/shutdown

Setup

  1. Add "shutdown" to your INSTALLED_APPS setting like this::

          INSTALLED_APPS = (
              ...
              'shutdown',
          )
  2. Add the shutdown middleware to your MIDDLEWARE_CLASSES setting like this::

          MIDDLEWARE_CLASSES= (
              ...
              'shutdown.middleware.ShutdownMiddleware',
          )
  3. Add an SHUTDOWN_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')::

       SHUTDOWN_CONTEXT = 'path.to.your.desired.context.object'
  4. Run python manage.py migrate to create the shutdown 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.

How To Implement a Shutdown

Implementing a shutdown is relatively simple. You simply need to add a message entry to the SHUTDOWN_SHUTDOWN table, and all susequent requests to your application will automatically render the shutdown page with that message. Once you are ready to resume normal operations, you simply delete that record from the table.

How you add and remove the record is entirely up to you. You can edit the table directly using SQL Developer, or you could write a simple interface that allows your administrative users to add/remove a table entry, and implement shutdowns as they desire.

Releases

  • v1.1.0 (2015/02/05)

    • Adding support for Django 1.7, including Django Migrations
    • Adding missing bracket in template
    • Renaming view class from Shutdown to ShutdownView
    • Adding __version__ to module
  • v1.0 (2014/05/29)

    • initial release with support for at least:
      • Python 2.6
      • Django 1.4
      • South 0.7.3

shutdown's People

Contributors

jtgraves avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.