- Flask By Example
- Gareth Dwyer
- 260字
- 2021-07-09 20:06:53
Chapter 2. Getting Started with Our Headlines Project
Now that our Hello World application is up and running, we have all the groundwork in place to create a more useful application. Over the next few chapters, we'll create a Headlines application that displays up-to-date news headlines, weather information, and currency exchange rates to our users.
In this chapter, we'll introduce RSS feeds and show how to use them to automatically retrieve recent news articles from specific publications. In the next chapter, we'll discuss how to use templates to display headlines and summaries of the retrieved articles to our users. Chapter 4, User Input for Our Headlines Page Project, will show you how to get input from users so that they can customize their experience and will also look at how to add weather and currency data to our application. We'll finish off the project in Chapter 5, Improving the User Experience of Our Headlines Project, by adding some CSS styles and looking at how to remember our users' preferences from one visit to the next.
By the end of this chapter, you'll have learned how to create a more complex Flask application. We'll pull raw data from real-world news stories and build up HTML formatting to display this to our user. You'll also learn more about routing—that is, having different URLs trigger different parts of our application's code.
In this chapter, we will cover the following topics:
- Setting up our project and a Git repository
- Creating a new Flask application
- Introduction to RSS and RSS feeds