cyberdelia / manifesto Goto Github PK
View Code? Open in Web Editor NEWPluggable cache manifest for Django
Home Page: https://manifesto.readthedocs.io
Pluggable cache manifest for Django
Home Page: https://manifesto.readthedocs.io
Please provide some introduction what this project is about.
I'm glad that you've got some kind of README and some docs on RTD, but nowhere is the purpose of this module explained. I think I have an idea of what it's used for, but I'm not positive.
Can we get a brief note on this in the README and the front page of the docs?
class StaticManifest(Manifest):
def cache(self):
return [
u'/static/blah.js',
]
def network(self):
return [u'test1', u'test2']
def fallback(self):
return [
('/', '/offline.html'),
]
The first access of the manifest works correctly. The second attempt crashes with:
Environment:
Request Method: GET
Request URL: http://localhost:8000/manifest.appcache
Django Version: 1.4
Python Version: 2.7.3
Traceback:
File "/home/aaron/.virtualenvs/ticketapp/local/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response
111. response = callback(request, *callback_args, **callback_kwargs)
File "/home/aaron/.virtualenvs/ticketapp/local/lib/python2.7/site-packages/django/views/generic/base.py" in view
48. return self.dispatch(request, *args, **kwargs)
File "/home/aaron/.virtualenvs/ticketapp/local/lib/python2.7/site-packages/django/views/generic/base.py" in dispatch
69. return handler(request, *args, **kwargs)
File "/home/aaron/.virtualenvs/ticketapp/local/lib/python2.7/site-packages/django/views/generic/base.py" in get
123. context = self.get_context_data(**kwargs)
File "/home/aaron/.virtualenvs/ticketapp/local/lib/python2.7/site-packages/manifesto/views.py" in get_context_data
16. 'revision': manifest.revision,
File "/home/aaron/.virtualenvs/ticketapp/local/lib/python2.7/site-packages/manifesto/__init__.py" in revision
84. revision = [manifest.revision() for manifest in self.manifests]
File "/home/aaron/.virtualenvs/ticketapp/local/lib/python2.7/site-packages/manifesto/manifest.py" in revision
19. return sha_constructor(bencode(revision)).hexdigest()[:7]
File "/home/aaron/.virtualenvs/ticketapp/local/lib/python2.7/site-packages/bencode/__init__.py" in bencode
130. encode_func[type(x)](x, r)
File "/home/aaron/.virtualenvs/ticketapp/local/lib/python2.7/site-packages/bencode/__init__.py" in encode_list
101. encode_func[type(i)](i, r)
Exception Type: KeyError at /manifest.appcache
Exception Value: <type 'unicode'>
Hello,
thanks for this app
I have a problem integrating manifesto as app in my django project, but my principal question is:
Is there a easy way to add a per-user manifest within your app? including user parameters such as a selection of user's images related to the user profile configuration? In order to add only the user related images in the per-user manifest?
thanks for your future answer
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.
I overrided pipeline's built-in manifest in order to make some local changes, and added pipeline.manifest.PipelineManifest
to MANIFESTO_EXCLUDED_MANIFESTS
but I was getting entries in the manifest from both PipelineManifest
and my own local manifest LocalManifest
. It turns out this was happening because I was importing pipeline.manifest.PipelineManifest
in my own manifest.py
for overriding, like so:
from pipeline.manifest import PipelineManifest`
class LocalManifest(PipelineManifest):
I managed to get the manifest to only include entries from LocalManifest
by setting MANIFESTO_EXCLUDED_MANIFESTS
like so:
MANIFESTO_EXCLUDED_MANIFESTS = (
'pipeline.manifest.PipelineManifest',
'my.local.manifest.PipelineManifest'
)
This is pretty non-intuitive, it seems like a bug in the manifest detection/exclusion mechanism to me.
Hello with Django 1.4 I receive this issue:
TemplateDoesNotExist at /manifest.appcache
manifesto/manifest.appcache
Request Method: GET
Request URL: http://192.168.5.251:40404/manifest.appcache
Django Version: 1.4
Exception Type: TemplateDoesNotExist
Exception Value:
manifesto/manifest.appcache
Exception Location: /usr/lib/python2.7/site-packages/Django-1.4-py2.7.egg/django/template/loader.py in select_template, line 193
Python Executable: /usr/bin/python
Python Version: 2.7.3
Error :
File "/home/sebastien/.virtualenvs/x/local/lib/python2.7/site-packages/manifesto/__init__.py", line 6, in <module>
from django.utils import importlib
ImportError: cannot import name importlib
django.utils.importlib
was deprecated in Django 1.7 and removed in Django 1.9. Change imports from:
from django.utils import importlib
to
import importlib
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.