Alright , let’s get to it.
Once you have made your project , app and added it to your settings.py (INSTALLED_APPS) and urls.py file we’ll begin with working on the app.
Know once inside your app set urlpatterns inside urls.py to 3 functions within views.py. To accept the feed link, to save into models and display the content if a valid link is provided and to show the links the user have entered so far.
The “feed” function is used to render the template for the user to input the link which is further passed into the “search” function .
Inside the “search” function we check if the user entered a blank text or an invalid link. Else using “feedparser” we extract the data from the feed and using regex we remove those unwanted html tags (<>) to make it look cleaner and finally rendered with the template.
Since we also need to save the link , if valid , into the models.py file, we make the following class.
And we come back into views.py , to make our “get” function to display the stored links. We obtain the links from the model using “RequestContext” in the form of a dictionary and then rendered with the template.
Now if you’re wondering how I got in the bootstrap files , all you have to do is make a “static” folder inside your app and place your bootstrap folders.
For reference visit my Github repo.
And that’s it!