-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Setup templates to configure cache without middleware
--HG-- branch : 0.10
- Loading branch information
Showing
6 changed files
with
32 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,21 @@ | ||
"""The application's Globals object""" | ||
|
||
from beaker.cache import CacheManager | ||
from beaker.util import parse_cache_config_options | ||
|
||
class Globals(object): | ||
|
||
"""Globals acts as a container for objects available throughout the | ||
life of the application | ||
""" | ||
|
||
def __init__(self, config): | ||
"""One instance of Globals is created during application | ||
initialization and is available during requests via the | ||
'app_globals' variable | ||
""" | ||
self.message = 'Hello' | ||
self.counter = 0 | ||
|
||
def __del__(self): | ||
""" | ||
Put any cleanup code to be run when the application finally exits | ||
here. | ||
""" | ||
pass | ||
self.cache = CacheManager(**parse_cache_config_options(config)) |