Code Monkey home page Code Monkey logo

Comments (7)

davidgomezcol avatar davidgomezcol commented on July 24, 2024 1

Great! thank you very much! didn't mean to put this as a bug, but github didn't give me another option. Thank you for you quick reply..

from django-maintenance-mode.

fabiocaccamo avatar fabiocaccamo commented on July 24, 2024

@davidgomezcol as documentation says:

# list of urls that will not be affected by the maintenance-mode
# urls will be used to compile regular expressions objects
MAINTENANCE_MODE_IGNORE_URLS = ()

So you just need to "prepare" your url for regex usage:

MAINTENANCE_MODE_IGNORE_URLS = ('192\.168\.0\.0\/32',)

from django-maintenance-mode.

fabiocaccamo avatar fabiocaccamo commented on July 24, 2024

Don't worry!

from django-maintenance-mode.

davidgomezcol avatar davidgomezcol commented on July 24, 2024

Hello!.. I'm adding my ip addresses like this.. but it doesn't seem to work.. i'm still having 503's after this.. and there's a bunch of them.. i'm just sharing you a little.. there's about of 200 ip addresses that i need to add there..
MAINTENANCE_MODE_IGNORE_IP_ADDRESSES = ( '31\.186\.232\.0\/24', '34\.90\.192\.162', '37\.230\.97\.9', '63\.251\.76\.0\/25',)

I tested both ways and is not working for me... --- > MAINTENANCE_MODE_IGNORE_URLS

from django-maintenance-mode.

fabiocaccamo avatar fabiocaccamo commented on July 24, 2024

Sorry, but there is some confusion here:

  • MAINTENANCE_MODE_IGNORE_URLS check a match in the url path, excluding the domain name.
  • MAINTENANCE_MODE_IGNORE_IP_ADDRESSES check a match in the client ip returned by MAINTENANCE_MODE_GET_CLIENT_IP_ADDRESS (see the README).

So, in your case you should add ip-addresses to MAINTENANCE_MODE_IGNORE_IP_ADDRESSES (without escaping them) and write your own custom MAINTENANCE_MODE_GET_CLIENT_IP_ADDRESS function.

from django-maintenance-mode.

davidgomezcol avatar davidgomezcol commented on July 24, 2024

I'm using django-ipware to get the user ip address.. the problem is that i have is with this kind of ip addresses 23.64.0.0/14 that could be a bunch of them, so if django-ipware grabs the ip address for example 23.67.255.255 that would be in the list of ip address from 23.64.0.0/14. I thought that probably this could have an internal function that handles that kind of situation, where can be a added this way.. i have a large list of ip addresses that i need to add like that..

from django-maintenance-mode.

fabiocaccamo avatar fabiocaccamo commented on July 24, 2024

You should write your own function wrapping ipware.

from django-maintenance-mode.

Related Issues (20)

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.