New to ASGI? Read through the excellent Introduction to ASGI: Emergence of an Async Python Web Ecosystem blog post.
https://florimond.dev/en/posts/2019/08/introduction-to-asgi-async-python-web/
https://florimond.dev/en/posts/2019/08/introduction-to-asgi-async-python-web/
Florimond Manca
Introduction to ASGI: Emergence of an Async Python Web Ecosystem - Florimond Manca
If you were thinking Python had been getting locked into data science, think again! Python web development is back with an async spin, and it's exciting.
Pytest docs: https://docs.pytest.org/en/latest/index.html
Pytest for Beginners: https://testdriven.io/blog/pytest-for-beginners/
Fixtures: https://pybit.es/articles/pytest-fixtures/
Pytest for Beginners: https://testdriven.io/blog/pytest-for-beginners/
Fixtures: https://pybit.es/articles/pytest-fixtures/
Pytest Commands
# normal run
$
$
$
$
$
$
$
$
$
$
# normal run
$
docker-compose exec web python -m pytest
# selecting test $
docker-compose exec web python -m pytest -k ping
# disable warnings$
docker-compose exec web python -m pytest -p no:warnings
# run only the last failed tests$
docker-compose exec web python -m pytest --lf
# run only the tests with names that match the string expression$
docker-compose exec web python -m pytest -k "summary and not test_read_summary"
# stop the test session after the first failure$
docker-compose exec web python -m pytest -x
# enter PDB after first failure then end the test session$
docker-compose exec web python -m pytest -x --pdb
# stop the test run after two failures$
docker-compose exec web python -m pytest --maxfail=2
# show local variables in tracebacks$
docker-compose exec web python -m pytest -l
# list the 2 slowest tests$
docker-compose exec web python -m pytest --durations=2Celery with FastAPI
1. https://medium.com/cuddle-ai/async-architecture-with-fastapi-celery-and-rabbitmq-c7d029030377
2. https://testdriven.io/courses/fastapi-celery/
1. https://medium.com/cuddle-ai/async-architecture-with-fastapi-celery-and-rabbitmq-c7d029030377
2. https://testdriven.io/courses/fastapi-celery/
Medium
Async Architecture with FastAPI, Celery, and RabbitMQ
In one of my earlier tutorials, we have seen how we can optimize the performance of a FastAPI application using Async IO. To know more you…
👍2
Alembic Docs for SqlAlchemy Orm Migrations
https://alembic.sqlalchemy.org/en/latest/index.html
https://alembic.sqlalchemy.org/en/latest/index.html
Here is a list of the errors sqlalchemy itself can raise, taken from help(sqlalchemy.exc) and help(sqlalchemy.orm.exc):
ConcurrentModificationError
sqlalchemy.exc:
ArgumentError - Raised when an invalid or conflicting function argument is supplied. This error generally corresponds to construction time state errors.CircularDependencyError - Raised by topological sorts when a circular dependency is detectedCompileError - Raised when an error occurs during SQL compilationConcurrentModificationError
DBAPIError - Raised when the execution of a database operation fails. If the error-raising operation occured in the execution of a SQL statement, that statement and its parameters will be available on the exception object in the statement and params attributes. The wrapped exception object is available in the orig attribute. Its type and properties are DB-API implementation specific.DataError - Wraps a DB-API DataError.DatabaseError - Wraps a DB-API DatabaseError.DisconnectionError - A disconnect is detected on a raw DB-API connection. be raised by a PoolListener so that the host pool forces a disconnect.FlushError
IdentifierError - Raised when a schema name is beyond the max character limitIntegrityError - Wraps a DB-API IntegrityError.InterfaceError - Wraps a DB-API InterfaceError.InternalError - Wraps a DB-API InternalError.InvalidRequestError - SQLAlchemy was asked to do something it can't do. This error generally corresponds to runtime state errors.NoReferenceError - Raised by ForeignKey to indicate a reference cannot be resolved.NoReferencedColumnError - Raised by ForeignKey when the referred Column cannot be located.NoReferencedTableError - Raised by ForeignKey when the referred Table cannot be located.NoSuchColumnError - A nonexistent column is requested from a RowProxy.NoSuchTableError - Table does not exist or is not visible to a connection.NotSupportedError - Wraps a DB-API NotSupportedError.OperationalError - Wraps a DB-API OperationalError.ProgrammingError - Wraps a DB-API ProgrammingError.SADeprecationWarning - Issued once per usage of a deprecated API.SAPendingDeprecationWarning - Issued once per usage of a deprecated API.SAWarning - Issued at runtime.SQLAlchemyError - Generic error class.SQLError - Raised when the execution of a database operation fails.TimeoutError - Raised when a connection pool times out on getting a connection.UnboundExecutionError - SQL was attempted without a database connection to execute it on.UnmappedColumnErrorsqlalchemy.orm.exc:
ConcurrentModificationError - Rows have been modified outside of the unit of work.FlushError - A invalid condition was detected during flush().MultipleResultsFound - A single database result was required but more than one were found.NoResultFound - A database result was required but none was found.ObjectDeletedError - A refresh() operation failed to re-retrieve an object's row.UnmappedClassError - A mapping operation was requested for an unknown class.UnmappedColumnError - Mapping operation was requested on an unknown column.UnmappedError - TODOUnmappedInstanceError - A mapping operation was requested for an unknown instance.👍5❤4😁1
https://vsdudakov.github.io/fastadmin/index.html
This is Admin Panel for FastAPi project using orm whatever you want like Tortoise Orm, Django Orm, Sqlalchemy Orm, Sony etc.
Check it out and tell about result of integration with your project. It is good or bad ?
This is Admin Panel for FastAPi project using orm whatever you want like Tortoise Orm, Django Orm, Sqlalchemy Orm, Sony etc.
Check it out and tell about result of integration with your project. It is good or bad ?
vsdudakov.github.io
FastAdmin | Documentation
FastAdmin is an easy-to-use admin dashboard for FastAPI, Django, and Flask, inspired by Django Admin.
👍7
To make admin panel for fastapi project review and try to implement this Piccolo ORM and leave your thoughts in the comment.
Link
Link
Linkedin
#python #fastapi #piccolo #orm #admingui | Murtazo Xurramov
Hello everyone! Well, we FastAPI devs have always been bothered by the lack of ready-made admin panel and SQLAlchemy ORM running a bit slow on big projects. I've used FastAPI and Piccolo on a medium-sized project and the impressions I've gotten are great!…
🔥9