Giter Club home page Giter Club logo

django-twitter-feed's Introduction

django-twitter-feed

Really simple app to show a Twitter feed in your Django application.

It's using a a task to update the feed regularly.

Liam Notes:

This package has been updated to work with Django 1.8 on servers that have time zones active.

If Django does not detect any migrations for the "twitter_feed" app, it is possible that you will need to copy the models in twitter_feed/modals.py into your app's models.py file.

INSTALL:

pip install git+https://github.com/liamdebeasi/django-twitter-feed.git

Set-up:

1.Add it to your "INSTALLED_APPS" settings:

INSTALLED_APPS = (
    ...
    'twitter_feed',
    ...
)

2.Add your twitter account API access in the settings like this:

TWITTER_FEED_CONSUMER_PUBLIC_KEY = '...'
TWITTER_FEED_CONSUMER_SECRET = '...'
TWITTER_FEED_OPEN_AUTH_TOKEN = '...'
TWITTER_FEED_OPEN_AUTH_SECRET = '...'

3.Run python manage.py migrate (if you use South) or python manage.py syncdb

4.Run the following command lines to test your Twitter credentials and save the initial feeds:

  • python manage.py update_tweets
  • python manage.py show_tweets

5.In a template, show the latest 10 tweets for example:

{% load twitter_feed_tags %}
{% latest_tweets 10 %}

6.Customise the template - simply create a copy of twitter_feed/latest_tweets.html and edit it.

For example:

{% load twitter_feed_tags %}

<div class="tweets">
	{% for tweet in tweets %}
      <div class="tweet">
	    <p>{{ tweet.content|linkify_twitter_status|urlize|url_target_blank }}</p>
    	<p class="date">{{ tweet.published_at|date:"F d, Y" }}</p>
      </div>
	{% endfor %}
</div>

7.Make sure python manage.py update_tweets is regurlalry called.

django-twitter-feed's People

Contributors

ebrelsford avatar francoisconstant avatar liamdebeasi avatar

Forkers

owlvark

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.