Coder Social home page Coder Social logo

flasklearning's Introduction

FlaskLearning

Источник The Flask Mega-Tutorial

Chapter 1: Hello, World!

Подключение модуля venv

cd microblog
python3 -m venv venv

Активация venv для Linux

source venv/bin/activate

Или для Windows

source venv/Scripts/activate

Деактивация venv

deactivate

Установка пакетов

pip install flask
pip install python-dotenv

Chapter 2: Templates

Ничего важного

Chapter 3: Web Forms

Установка пакетов

pip install flask-wtf

Chapter 4: Database

Установка пакетов

pip install flask-sqlalchemy
pip install flask-migrate

Создание модели и миграции

Сначала требуется инициализировать миграцию

flask db init

Создаем модель, например User. Выполнить создание миграции

flask db migrate -m "users table"

И применить изменения в БД

flask db upgrade

Для работы с объектами проекта можно использовать команду

flask shell

Chapter 5: User Logins

Установка пакетов

pip install flask-login
pip install email-validator

Chapter 6: Profile Page and Avatars

Добавляем поля в модель. Создаёт новую миграцию и применяем ее к БД

flask db migrate -m "new fields in user model"
flask db upgrade

Chapter 7: Error Handling

Добавляем окружение в .flaskenv

FLASK_ENV=development

Установка модуля SMTP

python -m smtpd -n -c DebuggingServer localhost:8025

Chapter 8: Followers

Добавляем поля в модель. Создаёт новую миграцию и применяем ее к БД

flask db migrate -m "followers"
flask db upgrade

Добавлены тесты.

Chapter 9: Pagination

Ничего важного

Chapter 10: Email Support

Chapter 11: Facelift

Chapter 12: Dates and Times

Chapter 13: I18n and L10n

Chapter 14: Ajax

Chapter 15: A Better Application Structure

Chapter 16: Full-Text Search

Chapter 17: Deployment on Linux

Chapter 18: Deployment on Heroku

Chapter 19: Deployment on Docker Containers

Chapter 20: Some JavaScript Magic

Chapter 21: User Notifications

Chapter 22: Background Jobs

Chapter 23: Application Programming Interfaces (APIs)

flasklearning's People

Contributors

patttern avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.