#3237: [patch] CIDR  in INTERNAL_IPS
------------------------------------------------------+---------------------
          Reporter:  Jeremy Dunck <[email protected]>  |         Owner:  nobody  
         
            Status:  reopened                         |     Milestone:          
         
         Component:  Core framework                   |       Version:          
         
        Resolution:                                   |      Keywords:  CIDR 
INTERNAL_IPS
             Stage:  Design decision needed           |     Has_patch:  0       
         
        Needs_docs:  0                                |   Needs_tests:  0       
         
Needs_better_patch:  0                                |  
------------------------------------------------------+---------------------
Changes (by kcarnold):

  * status:  closed => reopened
  * has_patch:  1 => 0
  * resolution:  wontfix =>

Comment:

 A simpler version (see http://www.djangosnippets.org/snippets/1380/)
 {{{
 from fnmatch import fnmatch
 class glob_list(list):
     def __contains__(self, key):
         for elt in self:
             if fnmatch(key, elt): return True
         return False

 INTERNAL_IPS = glob_list([
     '127.0.0.1',
     '18.85.*.*'
     ])
 }}}

 This is simple and useful enough that I'll entertain the thought of
 putting something like it in Django proper.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/3237#comment:5>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to