{"id":16417393,"url":"https://github.com/bashu/django-maintenancemode","last_synced_at":"2025-08-03T12:11:00.524Z","repository":{"id":2148836,"uuid":"3093749","full_name":"bashu/django-maintenancemode","owner":"bashu","description":"🛠 django-maintenancemode allows you to temporary shutdown your site for maintenance work","archived":false,"fork":false,"pushed_at":"2022-11-28T16:23:32.000Z","size":139,"stargazers_count":178,"open_issues_count":9,"forks_count":35,"subscribers_count":7,"default_branch":"develop","last_synced_at":"2025-03-24T09:44:21.718Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bashu.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGES.rst","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-01-03T11:47:36.000Z","updated_at":"2024-08-26T02:27:58.000Z","dependencies_parsed_at":"2023-01-13T11:39:46.344Z","dependency_job_id":null,"html_url":"https://github.com/bashu/django-maintenancemode","commit_stats":null,"previous_names":["shanx/django-maintenancemode"],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bashu%2Fdjango-maintenancemode","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bashu%2Fdjango-maintenancemode/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bashu%2Fdjango-maintenancemode/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bashu%2Fdjango-maintenancemode/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bashu","download_url":"https://codeload.github.com/bashu/django-maintenancemode/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247718778,"owners_count":20984633,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-11T07:11:29.075Z","updated_at":"2025-04-13T05:13:39.399Z","avatar_url":"https://github.com/bashu.png","language":"Python","readme":"django-maintenancemode\n======================\n\n.. image:: https://img.shields.io/pypi/v/django-maintenancemode.svg\n    :target: https://pypi.python.org/pypi/django-maintenancemode/\n\n.. image:: https://img.shields.io/pypi/dm/django-maintenancemode.svg\n    :target: https://pypi.python.org/pypi/django-maintenancemode/\n\n.. image:: https://img.shields.io/github/license/shanx/django-maintenancemode.svg\n    :target: https://pypi.python.org/pypi/django-maintenancemode/\n\n.. image:: https://app.travis-ci.com/bashu/django-maintenancemode.svg?branch=develop\n    :target: https://app.travis-ci.com/github/bashu/django-maintenancemode\n\n.. image:: https://coveralls.io/repos/github/shanx/django-maintenancemode/badge.svg?branch=develop\n    :target: https://coveralls.io/github/shanx/django-maintenancemode?branch=develop\n\ndjango-maintenancemode is a middleware that allows you to temporary shutdown\nyour site for maintenance work.\n\nLogged in users having staff credentials can still fully use\nthe site as can users visiting the site from an IP address defined in\nDjango's ``INTERNAL_IPS``.\n\nAuthored by `Remco Wendt \u003chttps://github.com/shanx\u003e`_, and some great `contributors \u003chttps://github.com/shanx/django-maintenancemode/contributors\u003e`_.\n\nHow it works\n------------\n\n``maintenancemode`` works the same way as handling 404 or 500 error in\nDjango work. It adds a ``handler503`` which you can override in your\nmain ``urls.py`` or you can add a ``503.html`` to your templates\ndirectory.\n\n* If user is logged in and staff member, the maintenance page is\n  not displayed.\n\n* If user's IP is in ``INTERNAL_IPS``, the maintenance page is\n  not displayed.\n\n* To override the default view which is used if the maintenance mode\n  is enabled you can simply define a ``handler503`` variable in your\n  ROOT_URLCONF_, similar to how you would customize other `error handlers`_,\n  e.g. :\n\n  .. code-block:: python\n\n      handler503 = 'example.views.maintenance_mode'\n\nInstallation\n------------\n\n1. Either checkout ``maintenancemode`` from GitHub, or install using pip :\n\n   .. code-block:: bash\n\n       pip install django-maintenancemode\n\n2. Add ``maintenancemode`` to your ``INSTALLED_APPS`` :\n\n   .. code-block:: python\n\n       INSTALLED_APPS = (\n           ...\n           'maintenancemode',\n       )\n\n3. Add ``MaintenanceModeMiddleware`` to ``MIDDLEWARE_CLASSES``, make sure it comes after ``AuthenticationMiddleware`` :\n\n   .. code-block:: python\n\n       MIDDLEWARE_CLASSES = (\n           ...\n           'django.contrib.auth.middleware.AuthenticationMiddleware',\n           'maintenancemode.middleware.MaintenanceModeMiddleware',\n       )                \n\n4. Add variable called ``MAINTENANCE_MODE`` in your project's ``settings.py`` file :\n\n   .. code-block:: python\n\n       MAINTENANCE_MODE = True  # Setting this variable to ``True`` activates the middleware.\n\n   or set ``MAINTENANCE_MODE`` to ``False`` and use ``maintenance`` command :\n\n   .. code-block:: shell\n\n       python ./manage.py maintenance \u003con|off\u003e\n\nPlease see ``example`` application. This application is used to\nmanually test the functionalities of this package. This also serves as\na good example...\n\nYou need only Django 1.4 or above to run that. It might run on older\nversions but that is not tested.\n\nConfiguration\n-------------\n\nThere are various optional configuration options you can set in your ``settings.py``\n\n.. code-block:: python\n\n    # Enable / disable maintenance mode.\n    # Default: False\n    MAINTENANCE_MODE = True  # or ``False`` and use ``maintenance`` command\n    \n    # Sequence of URL path regexes to exclude from the maintenance mode.\n    # Default: ()\n    MAINTENANCE_IGNORE_URLS = (\n        r'^/docs/.*',\n        r'^/contact'\n    )\n\nLicense\n-------\n\n``django-maintenancemode`` is released under the BSD license.\n\n.. _ROOT_URLCONF: https://docs.djangoproject.com/en/dev/ref/settings/#root-urlconf\n.. _`error handlers`: https://docs.djangoproject.com/en/dev/topics/http/views/#customizing-error-views\n","funding_links":[],"categories":["Python"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbashu%2Fdjango-maintenancemode","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbashu%2Fdjango-maintenancemode","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbashu%2Fdjango-maintenancemode/lists"}