[TalkPython] Создание управляемых данными веб-приложений с помощью Flask и SQLAlchemy [Michael Kennedy]
Создание управляемых данными веб-приложений с помощью Flask и SQLAlchemy
Автор Michael Kennedy (язык курса английский)
Краткое описание курса
Одна из областей, в которых Python действительно блестит, - это создание чистых и мощных веб-приложений. Как только вы изучите основы языка, этот курс научит вас всему, что вам нужно для создания управляемых данными современных веб-приложений на Python с веб-фреймворком Flask.
Для кого этот курс?
Этот курс предназначен для тех, кто хочет создавать веб-приложения на основе Python с использованием веб-инфраструктуры Flask. Фактически, вы изучите множество веб-навыков, которые также будут использоваться в разных средах.
Мы предполагаем, что у вас есть базовые знания языка Python и вы можете читать HTML и CSS. Но наиболее продвинутое использование языка или CSS объясняется в курсе.
Что вы узнаете на этом курсе?
Веб-разработка с полным стеком - это именно то, что вам нужно для создания настоящих управляемых данными веб-приложений на Python. Тем не менее, эти курсы могут быть запутанными и подавляющими из-за множества задействованных технологий (Python, SQL, CSS и т.д.).
Мы позаботились о том, чтобы создать курс, достаточно реальный, чтобы дать вам то, что вам нужно, без каких-либо дополнительных затрат. Мы создаем точную копию популярного веб-приложения с собственным индексом упаковки Python на pypi.org.
При создании нашей реплики PyPI вы узнаете:
Скрытое содержимое.
Создание управляемых данными веб-приложений с помощью Flask и SQLAlchemy
Автор Michael Kennedy (язык курса английский)
Краткое описание курса
Одна из областей, в которых Python действительно блестит, - это создание чистых и мощных веб-приложений. Как только вы изучите основы языка, этот курс научит вас всему, что вам нужно для создания управляемых данными современных веб-приложений на Python с веб-фреймворком Flask.
Для кого этот курс?
Этот курс предназначен для тех, кто хочет создавать веб-приложения на основе Python с использованием веб-инфраструктуры Flask. Фактически, вы изучите множество веб-навыков, которые также будут использоваться в разных средах.
Мы предполагаем, что у вас есть базовые знания языка Python и вы можете читать HTML и CSS. Но наиболее продвинутое использование языка или CSS объясняется в курсе.
Что вы узнаете на этом курсе?
Веб-разработка с полным стеком - это именно то, что вам нужно для создания настоящих управляемых данными веб-приложений на Python. Тем не менее, эти курсы могут быть запутанными и подавляющими из-за множества задействованных технологий (Python, SQL, CSS и т.д.).
Мы позаботились о том, чтобы создать курс, достаточно реальный, чтобы дать вам то, что вам нужно, без каких-либо дополнительных затрат. Мы создаем точную копию популярного веб-приложения с собственным индексом упаковки Python на pypi.org.
При создании нашей реплики PyPI вы узнаете:
- Узнайте о различных основных веб-фреймворках Python
- Создайте сайт на основе Flask с нуля, используя CLI и PyCharm
- Работа с динамическими шаблонами HTML
- Сопоставьте URL для просмотра методов с использованием маршрутизации
- Используйте расширенную маршрутизацию для создания полноценной CMS за 8 минут
- Воспользуйтесь начальной загрузкой для создания хорошо спроектированных сайтов
- Отображение данных в и из Python с использованием классов с помощью SQLAlchemy
- Узнайте, как Alembic может помочь нашей базе данных развиваться при изменении наших моделей
- Принять пользовательский ввод с HTML-формами
- Добавить клиентскую и серверную проверку
- Преодолеть особые проблемы тестирования веб-приложений (базы данных, фреймворки и т. Д.)
- Разверните наше веб-приложение на новой машине с Linux (виртуальной, облачной)
- Используйте наши шаблоны проектирования для преобразования нашего приложения в другую модель данных (издание MongoDB)
Welcome to the course
Introducing the course
The incredible power of web
What is fullstack development?
Student expectations and pre-reqs
The technologies we will learn
What can you build with Python?
Course topics
Meet your instructor
What app will we build for this course?
Video player: A quick feature tour
The incredible power of web
What is fullstack development?
Student expectations and pre-reqs
The technologies we will learn
What can you build with Python?
Course topics
Meet your instructor
What app will we build for this course?
Video player: A quick feature tour
Setup
Do you have Python 3? How do you get it?
Our code editor
Git the source code
Following along
Introducing the Flask frameworkOur code editor
Git the source code
Following along
What are microframeworks?
Building blocks of Flask
Building block: Views
Building block: Routes and URLs
Building block: Models
Building block: Dynamic HTML Templates
Get the back story
Your first Flask siteBuilding blocks of Flask
Building block: Views
Building block: Routes and URLs
Building block: Models
Building block: Dynamic HTML Templates
Get the back story
Introduction to creating a Flask website
Demo: CLI starter site
Concepts: CLI starter site
Demo: Creating the starter project PyCharm
Concept: Creating the starter project PyCharm
Project structure
Jinja2 templatesDemo: CLI starter site
Concepts: CLI starter site
Demo: Creating the starter project PyCharm
Concept: Creating the starter project PyCharm
Project structure
Template chapter introduction
Jinja2 template example
Create the PyPI site
Our first jinja template
Concept: Jinja2 templates
Layout: Motivation
Jinja2 autocomplete in PyCharm
Adding a simple nav element
Creating a common layout page
Better organization for your template files
Concepts: Common layout
Project structure with shared layout
Demo: @response a better render_template
Concept: @response a better render_template
Routing and URLsJinja2 template example
Create the PyPI site
Our first jinja template
Concept: Jinja2 templates
Layout: Motivation
Jinja2 autocomplete in PyCharm
Adding a simple nav element
Creating a common layout page
Better organization for your template files
Concepts: Common layout
Project structure with shared layout
Demo: @response a better render_template
Concept: @response a better render_template
Routing visualized
Demo: Routing, loading the project
Refactoring view methods with Flask blueprints
Concept: Refactoring view methods with Flask blueprints
Adding a constrained route
The account management routes
Concept: Create route from url
How to build a CMS in 8 minutes
Concept: Routing to add a custom CMS
Bootstrap and frontend CSS frameworksDemo: Routing, loading the project
Refactoring view methods with Flask blueprints
Concept: Refactoring view methods with Flask blueprints
Adding a constrained route
The account management routes
Concept: Create route from url
How to build a CMS in 8 minutes
Concept: Routing to add a custom CMS
What we'll cover
CSS Front-end framework survey
Introduction to using Bootstrap
Running in a real web server
Intro to grid layout
Responsive browser tools
Grid layout in action
Adding to the grid
Concept: Grid layout
Buttons and forms
Buttons and forms in action
Style the login form
Concept: Buttons and forms
Why Bootstrap themes are awesome
Bootstrap theme tour
Adding our designCSS Front-end framework survey
Introduction to using Bootstrap
Running in a real web server
Intro to grid layout
Responsive browser tools
Grid layout in action
Adding to the grid
Concept: Grid layout
Buttons and forms
Buttons and forms in action
Style the login form
Concept: Buttons and forms
Why Bootstrap themes are awesome
Bootstrap theme tour
Our site design
Home page HTML
The making of the hero
Stats slice
New releases
Adding the navigation
Final footer
Modeling data with SQLAlchemy classesHome page HTML
The making of the hero
Stats slice
New releases
Adding the navigation
Final footer
Introducing SQLAlchemy
Who uses SQLAlchemy?
Architecture
The database model
Modeling packages
SQLAlchemy model base class
Connecting to our 'database'
Creating tables
Indexes
The rest of the tables
Relationships
Concepts: Modeling
Using SQLAchemyWho uses SQLAlchemy?
Architecture
The database model
Modeling packages
SQLAlchemy model base class
Connecting to our 'database'
Creating tables
Indexes
The rest of the tables
Relationships
Concepts: Modeling
Creating the basic insert script
Connecting to the database (again)
Setting package values
Saving the package to the db
Running the inserts
Adding type hints to the session factory
Inserting real PyPI data
Concept: Unit of work
Querying data: Home page
Querying data: Latest releases
Working with package details
Concept: Querying data
Concept: Ordering data
Concept: Database updates
Concept: Relationships
Concept: Inserting data
Database migrations with AlembicConnecting to the database (again)
Setting package values
Saving the package to the db
Running the inserts
Adding type hints to the session factory
Inserting real PyPI data
Concept: Unit of work
Querying data: Home page
Querying data: Latest releases
Working with package details
Concept: Querying data
Concept: Ordering data
Concept: Database updates
Concept: Relationships
Concept: Inserting data
Introducing database migrations
Getting started with Alembic
Our first change
More database changes
Concept: Getting started
Concept: Alembic - the manual version
Concept: auto-generating changes
User input and HTML formsGetting started with Alembic
Our first change
More database changes
Concept: Getting started
Concept: Alembic - the manual version
Concept: auto-generating changes
The basics of HTML input
GET-POST-Redirect pattern
Register for the site (getting started)
Registration form
A little design for the register form
Register POST action
Getting the submitted values
Creating the user
Login form
Login code
Creating a user session (cookies)
Navigation items based on user's session
One source of data
Client and server-side validationGET-POST-Redirect pattern
Register for the site (getting started)
Registration form
A little design for the register form
Register POST action
Getting the submitted values
Creating the user
Login form
Login code
Creating a user session (cookies)
Navigation items based on user's session
One source of data
The motivation for viewmodels
Viewmodel base class
Using a viewmodel
The register viewmodel
Concept: Viewmodel
Simplified view methods
Viewmodel data exchange
Server-side validation with Viewmodels
Client-side validation with HTML5
Concept: Client-side validation with HTML5
Testing web appsViewmodel base class
Using a viewmodel
The register viewmodel
Concept: Viewmodel
Simplified view methods
Viewmodel data exchange
Server-side validation with Viewmodels
Client-side validation with HTML5
Concept: Client-side validation with HTML5
Why write tests (web)
Special challenges of the web
3 types of web unit tests
Organizing your tests
Getting started with tests
Testing the register viewmodel
Avoiding the database call on register
Testing registration when inputs are invalid
Concept: Testing view models
Testing view methods
Concept Testing view methods
Integrated tests
The rest of the tests
Running tests outside of PyCharm
Concept: Testing the full web app
Pareto principle and testing with sitemaps
DeploymentSpecial challenges of the web
3 types of web unit tests
Organizing your tests
Getting started with tests
Testing the register viewmodel
Avoiding the database call on register
Testing registration when inputs are invalid
Concept: Testing view models
Testing view methods
Concept Testing view methods
Integrated tests
The rest of the tests
Running tests outside of PyCharm
Concept: Testing the full web app
Pareto principle and testing with sitemaps
Deployment overview and topology
02-creating-our-linux-server
The setup script and config files
Configure the server
Make the virtual environment always active
Setting up our code
Running under uWSGI
uWSGI as a service
Running in nginx
Adding SSL with Let's Encrypt
Concept: uWSGI
Concept: nginx
MongoDB edition02-creating-our-linux-server
The setup script and config files
Configure the server
Make the virtual environment always active
Setting up our code
Running under uWSGI
uWSGI as a service
Running in nginx
Adding SSL with Let's Encrypt
Concept: uWSGI
Concept: nginx
Introduction to the NoSQL version
Not a MongoDB course
How document databases work
Connecting to MongoDB
The user entity with mongoengine
Saving a user
The rest of the entities
Rewriting our queries
Fixing the login
Importing the data from SQL to Mongo
Home page cleanup
Package details cleanup
Concepts: MongoEngine and MongoDB
Course conclusionNot a MongoDB course
How document databases work
Connecting to MongoDB
The user entity with mongoengine
Saving a user
The rest of the entities
Rewriting our queries
Fixing the login
Importing the data from SQL to Mongo
Home page cleanup
Package details cleanup
Concepts: MongoEngine and MongoDB
You've done it!
Creating a new Flask app
Jinja2 templates and dynamic HTML
Layout pages
Routes
Themes
Querying data
Database migrations
GET-POST-Redirect
viewmodels
Testing web apps
Deployment
MongoDB edition
git the source code
Thanks and goodbye
Creating a new Flask app
Jinja2 templates and dynamic HTML
Layout pages
Routes
Themes
Querying data
Database migrations
GET-POST-Redirect
viewmodels
Testing web apps
Deployment
MongoDB edition
git the source code
Thanks and goodbye
Скрытое содержимое.
https://training.talkpython.fm/courses/explore_flask/building-data-driven-web-applications-in-python-with-flask-sqlalchemy-and-bootstrap