Django is a high-level framework which is written in Python which allows us to create server-side web applications. In this article, we will see how to create a News application using Django.
We will be using News Api and fetch all the headine news from the api. Read more about the api here news api.
Do the Following steps in command prompt or terminal:
Open the newsproject folder using a text editor. The directory structure should look like this
Create a “templates” folder in your newsapp and it in
In views, we create a view named index which takes a request and renders an html as a response. Firstly we import newsapi from NewsApiClient.
index.html in templates folder.
Now map the views to urls.py
Your output of the project should look like this –
- Fetching top news using News API
- Newspaper scraping using Python and News API
- Scrape most reviewed news and tweet using Python
- Python Desktop News Notifier in 20 lines
- Read latest news using newsapi | Python
- Django URL patterns | Python
- Views In Django | Python
- Weather app using Django | Python
- Django Migrations | Python
- Complete Django History | Python
- Python | Sessions framework using django
- Python | ToDo webapp using Django
- Intermediate fields in Django | Python
- Python | Form validation using django
- Python | Uploading images in Django
- Python | Django Admin Interface
- Python | Extending and customizing django-allauth
- Python | Relational fields in Django models
- Django manage.py migrate command | Python
- Python | Django-allauth setup and Configuration
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.