Git Product home page Git Product logo

django-feedparser's People

Contributors

nikolas avatar sveetch avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

django-feedparser's Issues

Can't unset the FEED_PLUGIN_TEMPLATE_CHOICES setting without hacking the code

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.

Can't handle unicode string as URL (Python 3)

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"")

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.