All Projects → kwiersma → flask-celery-sqlalchemy

kwiersma / flask-celery-sqlalchemy

Licence: other
An example app to show how to get Flask, Celery, and SQLAlchemy working together

Programming Languages

python
139335 projects - #7 most used programming language
HTML
75241 projects

Projects that are alternatives of or similar to flask-celery-sqlalchemy

Enferno
A Python framework based on Flask microframework, with batteries included, and best practices in mind.
Stars: ✭ 385 (+1066.67%)
Mutual labels:  sqlalchemy, celery
Full Stack
Full stack, modern web application generator. Using Flask, PostgreSQL DB, Docker, Swagger, automatic HTTPS and more.
Stars: ✭ 451 (+1266.67%)
Mutual labels:  sqlalchemy, celery
Tedivms Flask
Flask starter app with celery, bootstrap, and docker environment
Stars: ✭ 142 (+330.3%)
Mutual labels:  sqlalchemy, celery
flask-docker-compose
Flask application development skeleton with docker-compose
Stars: ✭ 22 (-33.33%)
Mutual labels:  celery
alchemy-mock
SQLAlchemy mock helpers.
Stars: ✭ 74 (+124.24%)
Mutual labels:  sqlalchemy
sanic-graphql-example
Sanic using Graphsql + SQLAlchemy example
Stars: ✭ 21 (-36.36%)
Mutual labels:  sqlalchemy
cloudrun-fastapi
FastAPI on Google Cloud Run
Stars: ✭ 112 (+239.39%)
Mutual labels:  sqlalchemy
ChefAPI
API using FastAPI and PostgreSQL for sharing or keeping track of awesome food recipes Based on Oauth2 and JWT 💎
Stars: ✭ 16 (-51.52%)
Mutual labels:  sqlalchemy
viaduct
CMS for via. Moved to https://gitlab.com/studieverenigingvia/viaduct
Stars: ✭ 16 (-51.52%)
Mutual labels:  sqlalchemy
Online-Judge
Online Judge for hosting coding competitions inside NIT Durgapur made by GNU/Linux Users' Group!
Stars: ✭ 19 (-42.42%)
Mutual labels:  celery
tifa
Yet another opinionated fastapi-start-kit with best practice
Stars: ✭ 82 (+148.48%)
Mutual labels:  sqlalchemy
lightflow
A lightweight, distributed workflow system
Stars: ✭ 67 (+103.03%)
Mutual labels:  celery
nim-gatabase
Connection-Pooling Compile-Time ORM for Nim
Stars: ✭ 103 (+212.12%)
Mutual labels:  sqlalchemy
IATI.cloud
The open-source IATI datastore for IATI data with RESTful web API providing XML, JSON, CSV output. It extracts and parses IATI XML files referenced in the IATI Registry and powered by Apache Solr.
Stars: ✭ 35 (+6.06%)
Mutual labels:  celery
Apollo
A basic Application with multiple functionalities built with FastAPI aim to help Users Buy New Items Provided using PaypalAPI 🚀
Stars: ✭ 22 (-33.33%)
Mutual labels:  sqlalchemy
flickr to google photos migration
A tool for migrating your photo library from Flickr to Google Photos
Stars: ✭ 39 (+18.18%)
Mutual labels:  celery
elasticsearch-dbapi
A DBAPI and SQLAlchemy dialect for Elasticsearch
Stars: ✭ 84 (+154.55%)
Mutual labels:  sqlalchemy
pyramid basemodel
Global base classes for Pyramid SQLAlchemy applications.
Stars: ✭ 14 (-57.58%)
Mutual labels:  sqlalchemy
python-flask-celery-example
Flask Rest API with the use of Celery
Stars: ✭ 41 (+24.24%)
Mutual labels:  celery
immuni-backend-analytics
Repository for the backend analytics
Stars: ✭ 39 (+18.18%)
Mutual labels:  celery

Flask + Celery + SQLAlchemy Example App

This example app demonstrates how to write Celery tasks that work with Flask and SQLAlchemy. I had a hard time finding a complete example that worked correctly.

Based on the the Flask-User-Starter-App.

Code characteristics

  • Tested on Python 3.9
  • Well organized directories with lots of comments
    • app
      • commands
      • models
      • static
      • templates
      • views
    • tests
  • Includes test framework (py.test)
  • Includes database migration framework (alembic)
  • Sends error emails to admins for unhandled exceptions

Setting up a development environment

We assume that you have git and virtualenv and virtualenvwrapper installed.

# Clone the code repository into ~/dev/my_app
mkdir -p ~/dev
cd ~/dev
git clone https://github.com/lingthio/Flask-User-starter-app.git my_app

# Create the 'my_app' virtual environment
mkvirtualenv -p PATH/TO/PYTHON my_app

# Install required Python packages
cd ~/dev/my_app
workon my_app
pipenv install

Configuring SMTP

Copy the local_settings_example.py file to local_settings.py.

cp app/local_settings_example.py app/local_settings.py

Edit the local_settings.py file.

Specifically set all the MAIL_... settings to match your SMTP settings

Note that Google's SMTP server requires the configuration of "less secure apps". See https://support.google.com/accounts/answer/6010255?hl=en

Note that Yahoo's SMTP server requires the configuration of "Allow apps that use less secure sign in". See https://help.yahoo.com/kb/SLN27791.html

Initializing the Database

# Create DB tables and populate the roles and users tables
python manage.py init_db

# Or if you have Fabric installed:
fab init_db

Running the app

# Start the Flask development web server
python manage.py runserver

# Or if you have Fabric installed:
fab runserver

Point your web browser to http://localhost:5000/

You can make use of the following users:

Running the automated tests

# Start the Flask development web server
py.test tests/

# Or if you have Fabric installed:
fab test

Trouble shooting

If you make changes in the Models and run into DB schema issues, delete the sqlite DB file app.sqlite.

Acknowledgements

With thanks to the following Flask extensions:

Flask-User-starter-app was used as a starting point for this code repository.

Authors

  • Kurt Wiersma (kwiersma at gmail.com)
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].