Skip to content

ine-rmotr-projects/wdd-w3-twitter-media-tweets

Repository files navigation

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

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published