-
-
Save alecklandgraf/5458408 to your computer and use it in GitHub Desktop.
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
#!/usr/bin/env python | |
# encoding: utf-8 | |
""" | |
Invalidate Johnny Cache's cache for given models outside "normal Django" | |
(e.g. in a management command). | |
""" | |
from johnny.cache import invalidate | |
from johnny.middleware import QueryCacheMiddleware | |
from stupid.models import Cheezburger, Kitten | |
def _main(): | |
QueryCacheMiddleware() | |
invalidate(Cheezburger, Kitten) | |
if __name__ == '__main__': | |
_main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment