sveetch / django-feedparser Goto Github PK
View Code? Open in Web Editor NEWA Django app using 'feedparser' to fetch and parse a feed to render it from a template
License: MIT License
A Django app using 'feedparser' to fetch and parse a feed to render it from a template
License: MIT License
On pypi, this is listed as the homepage: https://github.com/emencia/django-feedparser
But that's a broken link. Could you fix this?
For whatever reason, I can't override the default template without hacking the original code.
Ideally, it SHOULD be possible to just redefine the FEED_PLUGIN_TEMPLATE_CHOICES tuple in one's own settings file.
But that doesn't appear to work.
in the settings.py file:
> from django_feedparser.settings import *
> from cmsplugin_feedparser.settings import *
> FEED_PLUGIN_TEMPLATE_CHOICES = (
> ('feedparser_plugin/default.html', 'Kiosk Default template'),
> )
Then in the shell:
>>> from django.conf import settings
>>> settings.FEED_PLUGIN_TEMPLATE_CHOICES
(('django_feedparser/basic_feed_renderer.html', 'Default template'),)
>>>
which is not the desired result.
Traceback (most recent call last):
File "/usr/local/lib/python3.4/dist-packages/django/core/handlers/base.py", line 132, in get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/usr/local/lib/python3.4/dist-packages/django/views/generic/base.py", line 71, in view
return self.dispatch(request, *args, **kwargs)
File "/usr/local/lib/python3.4/dist-packages/django/views/generic/base.py", line 89, in dispatch
return handler(request, *args, **kwargs)
File "/usr/local/lib/python3.4/dist-packages/django/views/generic/base.py", line 158, in get
context = self.get_context_data(**kwargs)
File "/usr/local/lib/python3.4/dist-packages/django_feedparser/views.py", line 47, in get_context_data
context['feed_rendered'] = self.render_feed(feed_renderer, feed_url)
File "/usr/local/lib/python3.4/dist-packages/django_feedparser/views.py", line 31, in render_feed
return renderer().render(url, template=self.feed_template, expiration=self.feed_cache_expiration)
File "/usr/local/lib/python3.4/dist-packages/django_feedparser/renderer.py", line 138, in render
return render_to_string(template, self.get_context(url, expiration))
File "/usr/local/lib/python3.4/dist-packages/django_feedparser/renderer.py", line 126, in get_context
self._feed = self.get(url, expiration)
File "/usr/local/lib/python3.4/dist-packages/django_feedparser/renderer.py", line 99, in get
'id': hashlib.md5(url).hexdigest(),
TypeError: Unicode-objects must be encoded before hashing
Workaround is to pass the URL as a bytes string (b""
)
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.