Changes between Version 4 and Version 5 of CookBookIPAccessMiddleware
- Timestamp:
- Dec 21, 2006, 6:02:58 PM (18 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
CookBookIPAccessMiddleware
v4 v5 3 3 == The idea == 4 4 5 Control IP access in your web app. The idea provided in this cookbook let you define specific ip addresses, and controlling accessing from those ips. If an user access from a certain IP, automatically authenticates with a defined user.5 Controling IP access in your web app. The idea provided in this cookbook let you define specific ip addresses, and controlling accessing from those ips. If an user access from a certain IP, automatically authenticates with a defined user. 6 6 7 7 == IPAccess Model == … … 34 34 == IPAccess Middleware == 35 35 36 The middleware mission is authenticate automatically with an user defined in models, '''only if''' the remote ip address exists in IPAccesstable.36 Middleware mission is authenticate automatically with an user defined in models, '''only if''' the remote ip address exists in ''IPAccess'' table. 37 37 38 38 This is the code (in file ''myapp/middleware.py''): … … 58 58 == Settings == 59 59 60 The middleware installation requires you insert ''IPAccessMiddleware'' into ''MIDDLEWARE_CLASSES''. Obviusly, it also requires the installation of !''Aut enticationMiddleware''.60 The middleware installation requires you insert ''IPAccessMiddleware'' into ''MIDDLEWARE_CLASSES''. Obviusly, it also requires the installation of !''AuthenticationMiddleware''. 61 61 62 62 The code would be like that: