Git Product home page Git Product logo

django-site-maintenance's Introduction

django-site-maintenance's People

Contributors

saxix avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

django-site-maintenance's Issues

WSGI server config

Is would be useful to have a ready configuration for WSGI file. Pretty much any server runs Django via WSGI these days, so it would take care of great many possible configurations (Apache and nginx included). It would also enable this app to be used on shared servers or in other environments where webmasters have no direct control over server config files.

Are there any obstacles in coding that? I haven't looked at the internals in detail...

Changes to Apache Web Server Doc

Hi,

Thanks for posting this app. It works great. However, It seems there is a typo in the Apache Config in the docs. Currently the line is:

RewriteRule ^(.+) $MAINTENANCE_URL [RL]

That gives me an error. This seems to work (added a comma between RL):

RewriteRule ^(.+) $MAINTENANCE_URL [R,L]

Also, could you explain more what this line does:

RewriteCond %{REQUEST_URI} !/$STATIC_URL/maintenance/under-maintenance.gif

I am using my own maintenance.html that does not include that gif. Yet things still seem to work.

Thanks again,
Chuck

Support for python3 is needed

@saxix Do you planing update the django-site-maintenance?

 File "E:\Python36\lib\site-packages\django\core\servers\basehttp.py", line 45, in get_internal_wsgi_appl
ication
    return import_string(app_path)
  File "E:\Python36\lib\site-packages\django\utils\module_loading.py", line 17, in import_string
    module = import_module(module_path)
  File "E:\Python36\lib\importlib\__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 994, in _gcd_import
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "E:\django\_app\wsgi.py", line 17, in <module>
    application = get_wsgi_application()
  File "E:\Python36\lib\site-packages\django\core\wsgi.py", line 13, in get_wsgi_application
    return WSGIHandler()
  File "E:\Python36\lib\site-packages\django\core\handlers\wsgi.py", line 135, in __init__
    self.load_middleware()
  File "E:\Python36\lib\site-packages\django\core\handlers\base.py", line 35, in load_middleware
    middleware = import_string(middleware_path)
  File "E:\Python36\lib\site-packages\django\utils\module_loading.py", line 17, in import_string
    module = import_module(module_path)
  File "E:\Python36\lib\importlib\__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 994, in _gcd_import
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "E:\Python36\lib\site-packages\maintenance\middleware.py", line 3, in <module>
    from django.utils.importlib import import_module
ModuleNotFoundError: No module named 'django.utils.importlib'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "E:\Python36\lib\threading.py", line 916, in _bootstrap_inner
    self.run()
  File "E:\Python36\lib\threading.py", line 864, in run
    self._target(*self._args, **self._kwargs)
  File "E:\Python36\lib\site-packages\django\utils\autoreload.py", line 54, in wrapper
    fn(*args, **kwargs)
  File "E:\Python36\lib\site-packages\django\core\management\commands\runserver.py", line 137, in inner_ru
n
    handler = self.get_handler(*args, **options)
  File "E:\Python36\lib\site-packages\django\contrib\staticfiles\management\commands\runserver.py", line 2
7, in get_handler
    handler = super().get_handler(*args, **options)
  File "E:\Python36\lib\site-packages\django\core\management\commands\runserver.py", line 64, in get_handl
er
    return get_internal_wsgi_application()
  File "E:\Python36\lib\site-packages\django\core\servers\basehttp.py", line 50, in get_internal_wsgi_appl
ication
    ) from err
django.core.exceptions.ImproperlyConfigured: WSGI application '_app.wsgi.application' could not be loaded; Error importing module.

E:\django\_app\settings.py changed, reloading.
Watching for file changes with StatReloader
Performing system checks...

api.py #59

print("Active sessions detected. Waiting for logout. (Session timeout set to {} secs) ").format(SESSION_COOKIE_AGE)
                        print("Type double ^C to stop")
                        sys.stdout.write(
                            "%s pending sessions. %s (%d sec)\r" % (users, C[rounds % 2], round(time.time() - _start)))

Want sugesst to migrate as django-site-maintenance-2 including idea from:
https://github.com/alsoicode/django-maintenancemode-2
I mind the turn off by httacess is ok, but we need as phase 1 but we need phase 2 to test that all is ok as staff user only, then allow for all users.
It can be good to include in this the rest-framework as some maintenance/api.html (outpu as json "maintenace mode") and admin.html site.html other.html

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.