Giter Club home page Giter Club logo

wdd-w3-twitter-media-tweets's Introduction

Tweet media types

For this project, we'll use the Django Content Types framekwork to add different types of tweets to our Twitter clone. Specifically, we'll add image and video tweets to our regular text tweet. We'll need to make our Tweet model support different types of tweet, that should be generic. By "generic" we mean you can't hardcode a image_url field to the Tweet model. You'll need somehow make use of the model classes ImageTweet and VideoTweet from twitter/models.py. As usual, you'll find out that this process is really simple using the correct Django helper; in this case you might want to take a look at Generic Relations.

Once you finish implementing your project to support images and videos, try extending the project to support a new type of tweet GistTweet that receives a Github's Gist URL. If you've used generic relations, it's going to be simple to extend it.

Base project

As usual, we have our regular Twitter feed view:

image

But this time, we'll have the option of creating different type of tweets (image, video, or the usual text tweet):

image

Text Tweet

The default type is text:

image

Image Tweet

When you select the "Image Type" a form input will be shown to enter an image URL:

image

When you choose to tweet an image, you should see it in the template:

image

Video Tweet

A Video tweet should be created in the same way:

image

image

wdd-w3-twitter-media-tweets's People

Contributors

santiagobasulto avatar

Watchers

 avatar  avatar

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.