cyberdelia / manifesto

Pluggable cache manifest for Django

Home Page:https://manifesto.readthedocs.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Created manifest not picked

opened this issue · comments

Hi
Thank you for manifesto. Being relatively new to django, I am facing a problem while using manifesto. As mentioned in http://manifesto.readthedocs.org/en/0.3.3/usage.html, I created a manifest.py file in the project directory; that is where settings.py is present as shown below:

from manifesto import Manifest

class StaticManifest(Manifest):
    def revision(self):
        return 101

    def cache(self):
        return []

    def network(self):
        return ['*']

    def fallback(self):
        return []

I added the def revision(self) for testing purposes. My django app is cached, however when I open the manifest file, it shows default revision as shown below all the time, whether I refresh the page, clear the cache of the browser, etc.
CACHE MANIFEST
# rev 593b743

I think it's not considering StaticManifest that I provide. I'm sure I'm missing something very basic here. Please help. I'm stuck with this. Thanks in advance.

Did you add 'manifesto' to INSTALLED_APPS ?

Thanks for the reply, cyberdelia. Yes I have added. From my settings.py
INSTALLED_APPS = ( 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.messages', 'django.contrib.staticfiles', 'version1', 'django_appcache', 'manifesto', )

INSTALLED_APPS += ( 'tastypie', 'tastypie_mongoengine', )

Do I need to explicitly select the StaticManifest class inside manifest.py that I have created? If so then where should I do that? It is mentioned that you can create multiple manifests within manifest.py module. Hence if I have more than one manifest, I will have to give the name of the manifest that I need to use.

Your manifest.py should be in an app directory, not in your project, I guess it's version1 in your case.

A big thank you! Cyderdelia, it works now!. and sorry for the delay. I wanted to make sure everything worked.