Setting up the folders and files needed for a Flask app.
- [Narrator] Now that we've set up a development environment let's go ahead and start building a Flask app. We'll start in this section by building a home page with mostly static content. At the end we'll have a work flow that we can generalize to build more complex and dynamic pages in the rest of the Flask app. In this video we'll start by setting up the files and folders needed for the app. Let's start by creating a couple folders and files to keep the web app organized. As a first step let's get back into the isolated development environment we created when we installed Flask.
cd static, mkdir css, mkdir js, mkdir img. All right, create another folder named templates, this is where we'll store the app's HTML files. So let's go back up one level, cd ../ mkdir templates. Next, create an empty Python file named routes.py, this is where we're gonna write the app's main code.
So, touch routes.py. Probably create a file named README.md, this is where we can put information about the app, like what it does, how to contribute, and so forth. So, touch README.md. In this video we set up the files and folders needed for the Flask app. Your app folder should now look like this. Now, how do all these files fit together? We'll take a look at this in the next video.
The need for talented developers is greater than ever before. A basic grounding in a framework as simple, powerful, and easy-to-learn as Flask—a Python micro framework—can help launch your programming career. Get a basic grounding in the fundamental concepts of web development, as well as the hands-on experience required to successfully build web apps with Flask, in this course with Packt trainer Lalith Polepeddi.
It starts with turning your computer into a modern development machine. Then learn everything you need to know about Flask: models, views, controllers, web templates, forms, validation, and API interactions. Lalith shows how to apply these concepts and develop a powerful database-backed Flask app, including a full authentication system. Finally, Lalith shows how to extend the app's functionality by integrating it with third-party APIs. When you finish this course, you will be fully equipped to build your very own custom web apps with Flash.
- Setting up your development environment
- Creating a homepage
- Building templates
- Routing with Flask
- Deploying to Heroku
- Storing data
- Creating and rendering forms
- Validating form data
- Creating a user authentication system for login and logout
- Implementing location-based app features