Backend logic implementation for realworld with awesome FastAPI

Overview

./.github/assets/logo.png


Quickstart

First, run PostgreSQL, set environment variables and create database. For example using docker:

export POSTGRES_DB=rwdb POSTGRES_PORT=5432 POSTGRES_USER=postgres POSTGRES_PASSWORD=postgres
docker run --name pgdb --rm -e POSTGRES_USER="$POSTGRES_USER" -e POSTGRES_PASSWORD="$POSTGRES_PASSWORD" -e POSTGRES_DB="$POSTGRES_DB" postgres
export POSTGRES_HOST=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' pgdb)
createdb --host=$POSTGRES_HOST --port=$POSTGRES_PORT --username=$POSTGRES_USER $POSTGRES_DB

Then run the following commands to bootstrap your environment with poetry:

git clone https://github.com/nsidnev/fastapi-realworld-example-app
cd fastapi-realworld-example-app
poetry install
poetry shell

Then create .env file (or rename and modify .env.example) in project root and set environment variables for application:

touch .env
echo DB_CONNECTION=postgresql://$POSTGRES_USER:$POSTGRES_PASSWORD@$POSTGRES_HOST:$POSTGRES_PORT/$POSTGRES_DB >> .env
echo SECRET_KEY=$(openssl rand -hex 32) >> .env

To run the web application in debug use:

alembic upgrade head
uvicorn app.main:app --reload

Run tests

Tests for this project are defined in the tests/ folder.

This project uses pytest to define tests because it allows you to use the assert keyword with good formatting for failed assertations.

To run all the tests of a project, simply run the pytest command:

$ pytest
================================================= test session starts ==================================================
platform linux -- Python 3.8.3, pytest-5.4.2, py-1.8.1, pluggy-0.13.1
rootdir: /home/some-user/user-projects/fastapi-realworld-example-app, inifile: setup.cfg, testpaths: tests
plugins: env-0.6.2, cov-2.9.0, asyncio-0.12.0
collected 90 items

tests/test_api/test_errors/test_422_error.py .                                                                   [  1%]
tests/test_api/test_errors/test_error.py .                                                                       [  2%]
tests/test_api/test_routes/test_articles.py .................................                                    [ 38%]
tests/test_api/test_routes/test_authentication.py ..                                                             [ 41%]
tests/test_api/test_routes/test_comments.py ....                                                                 [ 45%]
tests/test_api/test_routes/test_login.py ...                                                                     [ 48%]
tests/test_api/test_routes/test_profiles.py ............                                                         [ 62%]
tests/test_api/test_routes/test_registration.py ...                                                              [ 65%]
tests/test_api/test_routes/test_tags.py ..                                                                       [ 67%]
tests/test_api/test_routes/test_users.py ....................                                                    [ 90%]
tests/test_db/test_queries/test_tables.py ...                                                                    [ 93%]
tests/test_schemas/test_rw_model.py .                                                                            [ 94%]
tests/test_services/test_jwt.py .....                                                                            [100%]

============================================ 90 passed in 70.50s (0:01:10) =============================================
$

This project does not use your local PostgreSQL by default, but creates it in docker as a container (you can see it if you type docker ps when the tests are executed, the docker container for PostgreSQL should be launched with with a name like test-postgres-725b4bd4-04f5-4c59-9870-af747d3b182f). But there are cases when you don't want to use docker for tests as a database provider (which takes an additional +- 5-10 seconds for its bootstrap before executing the tests), for example, in CI, or if you have problems with the docker driver or for any other reason. In this case, you can run the tests using your already running database with the following command:

$ USE_LOCAL_DB_FOR_TEST=True pytest

Which will use your local database with DSN from the environment variable DB_CONNECTION.

If you want to run a specific test, you can do this with this pytest feature:

$ pytest tests/test_api/test_routes/test_users.py::test_user_can_not_take_already_used_credentials

Deployment with Docker

You must have docker and docker-compose tools installed to work with material in this section. First, create .env file like in Quickstart section or modify .env.example. POSTGRES_HOST must be specified as db or modified in docker-compose.yml also. Then just run:

docker-compose up -d db
docker-compose up -d app

Application will be available on localhost in your browser.

Web routes

All routes are available on /docs or /redoc paths with Swagger or ReDoc.

Project structure

Files related to application are in the app or tests directories. Application parts are:

app
├── api              - web related stuff.
│   ├── dependencies - dependencies for routes definition.
│   ├── errors       - definition of error handlers.
│   └── routes       - web routes.
├── core             - application configuration, startup events, logging.
├── db               - db related stuff.
│   ├── migrations   - manually written alembic migrations.
│   └── repositories - all crud stuff.
├── models           - pydantic models for this application.
│   ├── domain       - main models that are used almost everywhere.
│   └── schemas      - schemas for using in web routes.
├── resources        - strings that are used in web responses.
├── services         - logic that is not just crud related.
└── main.py          - FastAPI application creation and configuration.
Comments
  • scalability issue

    scalability issue

    fastapi being fast and scalable, but it seems this example won't handle readworld benchmark. To repro, run this and benchmark with wrk -t1 -c100 -d10s --latency http://localhost:8000/api/articles, and any api accessing db is stuck :(

    Maybe we could increase the default MAX_CONNECTIONS_COUNT to a higher value.

    opened by mayli 6
  • Alembic configuration

    Alembic configuration

    Is alembic configured correctly? When I change the model, and run alembic revision, it generates an empty migration. It does not seem to pick up the changes made in models files.

    opened by Euphorbium 6
  • Bump pytest from 7.0.0 to 7.1.2

    Bump pytest from 7.0.0 to 7.1.2

    Bumps pytest from 7.0.0 to 7.1.2.

    Release notes

    Sourced from pytest's releases.

    7.1.2

    pytest 7.1.2 (2022-04-23)

    Bug Fixes

    • #9726: An unnecessary numpy import inside pytest.approx{.interpreted-text role="func"} was removed.
    • #9820: Fix comparison of dataclasses with InitVar.
    • #9869: Increase stacklevel for the NODE_CTOR_FSPATH_ARG deprecation to point to the user's code, not pytest.
    • #9871: Fix a bizarre (and fortunately rare) bug where the [temp_path]{.title-ref} fixture could raise an internal error while attempting to get the current user's username.

    7.1.1

    pytest 7.1.1 (2022-03-17)

    Bug Fixes

    • #9767: Fixed a regression in pytest 7.1.0 where some conftest.py files outside of the source tree (e.g. in the [site-packages]{.title-ref} directory) were not picked up.

    7.1.0

    pytest 7.1.0 (2022-03-13)

    Breaking Changes

    • #8838: As per our policy, the following features have been deprecated in the 6.X series and are now removed:

      • pytest._fillfuncargs function.
      • pytest_warning_captured hook - use pytest_warning_recorded instead.
      • -k -foobar syntax - use -k 'not foobar' instead.
      • -k foobar: syntax.
      • pytest.collect module - import from pytest directly.

      For more information consult Deprecations and Removals in the docs.

    • #9437: Dropped support for Python 3.6, which reached end-of-life at 2021-12-23.

    Improvements

    • #5192: Fixed test output for some data types where -v would show less information.

      Also, when showing diffs for sequences, -q would produce full diffs instead of the expected diff.

    ... (truncated)

    Commits
    • 2f2f1a6 Prepare release version 7.1.2
    • 5c04f3a [7.1.x] Fix wrong log_file docs (#9879)
    • 078733c Merge pull request #9872 from pytest-dev/backport-9871-to-7.1.x
    • 3a7ead6 [7.1.x] fix: move 'import getpass' statement to try-clause
    • 6d75333 [7.1.x] Increase stacklevel to point at user's code (#9870)
    • ddbb998 [7.1.x] Increase stacklevel to point at user's code
    • 0ec5886 Merge pull request #9855 from pytest-dev/backport-9854-to-7.1.x
    • f2469fc [7.1.x] Docs: link to easy issues in contributing guide
    • 94ec0f8 Merge pull request #9846 from pytest-dev/backport-9842-to-7.1.x
    • 5ef96fd [7.1.x] fix comparison of dataclasses with InitVar
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies python 
    opened by dependabot[bot] 5
  • Can you talk more about how you split queries between aiosql and pypika?

    Can you talk more about how you split queries between aiosql and pypika?

    This repository has shown me a very interesting way of organsing the db logic and I'm interested in the reasons behind your decisions. Thank you! (It's really amazing work and really helpful.)

    opened by npalladium 5
  • Test will try to use docker, even when told not to....

    Test will try to use docker, even when told not to....

    I created a local database that can be approached with ident authentication.

    Then in .env specified: DB_CONNECTION=postgresql+psycopg2:///real_world_application

    In an ipython shell I verified that I can use this string to the database.

    Still $ USE_LOCAL_DB_FOR_TEST=True pytest results in:

    
    During handling of the above exception, another exception occurred:
    ../../../.cache/pypoetry/virtualenvs/fastapi-realworld-example-app-qr8Xy3u9-py3.8/lib/python3.8/site-packages/docker/api/client.py:214: in _retrieve_server_version
        return self.version(api_version=False)["ApiVersion"]
    ../../../.cache/pypoetry/virtualenvs/fastapi-realworld-example-app-qr8Xy3u9-py3.8/lib/python3.8/site-packages/docker/api/daemon.py:181: in version
        return self._result(self._get(url), json=True)
    ../../../.cache/pypoetry/virtualenvs/fastapi-realworld-example-app-qr8Xy3u9-py3.8/lib/python3.8/site-packages/docker/utils/decorators.py:46: in inner
        return f(self, *args, **kwargs)
    ../../../.cache/pypoetry/virtualenvs/fastapi-realworld-example-app-qr8Xy3u9-py3.8/lib/python3.8/site-packages/docker/api/client.py:237: in _get
        return self.get(url, **self._set_request_timeout(kwargs))
    ../../../.cache/pypoetry/virtualenvs/fastapi-realworld-example-app-qr8Xy3u9-py3.8/lib/python3.8/site-packages/requests/sessions.py:555: in get
        return self.request('GET', url, **kwargs)
    ../../../.cache/pypoetry/virtualenvs/fastapi-realworld-example-app-qr8Xy3u9-py3.8/lib/python3.8/site-packages/requests/sessions.py:542: in request
        resp = self.send(prep, **send_kwargs)
    ../../../.cache/pypoetry/virtualenvs/fastapi-realworld-example-app-qr8Xy3u9-py3.8/lib/python3.8/site-packages/requests/sessions.py:655: in send
        r = adapter.send(request, **kwargs)
    ../../../.cache/pypoetry/virtualenvs/fastapi-realworld-example-app-qr8Xy3u9-py3.8/lib/python3.8/site-packages/requests/adapters.py:498: in send
        raise ConnectionError(err, request=request)
    E   requests.exceptions.ConnectionError: ('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))
    

    (Lots of the above...)

    opened by NL66278 4
  • User registration failed

    User registration failed "relation "users" does not exist"

    Dear nsidnev,

    I'm a fan of your architecture in this application. Unfortunately, I cannot figure out the error from the registration side:

    "asyncpg.exceptions.UndefinedTableError: relation "users" does not exist"

    I attached an image on how it looks like. I hope we could figure this out. Screenshot 2022-04-16 at 13 20 44

    Screenshot 2022-04-16 at 13 21 56

    Cheers and stay healthy.

    opened by Eternal-Engine 3
  • Bump databases from 0.4.3 to 0.5.0

    Bump databases from 0.4.3 to 0.5.0

    Bumps databases from 0.4.3 to 0.5.0.

    Release notes

    Sourced from databases's releases.

    Version 0.5.0

    0.5.0 (August 26th, 2021)

    Added

    • Support SQLAlchemy 1.4 (#299)

    Fixed

    • Fix concurrent transactions (#328)
    Changelog

    Sourced from databases's changelog.

    0.5.0 (August 26th, 2021)

    Added

    • Support SQLAlchemy 1.4 (#299)

    Fixed

    • Fix concurrent transactions (#328)
    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies python 
    opened by dependabot[bot] 3
  • [Security] Bump pydantic from 1.7.3 to 1.8.1

    [Security] Bump pydantic from 1.7.3 to 1.8.1

    Bumps pydantic from 1.7.3 to 1.8.1.

    Release notes

    Sourced from pydantic's releases.

    v1.8.1

    See Changelog.

    Bug fixes for regressions and new features in v1.8

    v1.8 (2021-02-26)

    See Changelog.

    Thank you to pydantic's sponsors: @​jorgecarleitao, @​BCarley, @​chdsbd, @​tiangolo, @​matin, @​linusg, @​kevinalh, @​koxudaxi, @​timdrijvers, @​mkeen, @​meadsteve, @​ginomempin, @​primer-io, @​and-semakin, @​tomthorogood, @​AjitZK, @​westonsteimel, @​Mazyod, @​christippett, @​CarlosDomingues, @​Kludex, @​r-m-n for their kind support.

    Highlights

    Changes

    • Breaking Change, remove old deprecation aliases from v1, #2415 by @​samuelcolvin:
      • remove notes on migrating to v1 in docs
      • remove Schema which was replaced by Field
      • remove Config.case_insensitive which was replaced by Config.case_sensitive (default False)
      • remove Config.allow_population_by_alias which was replaced by Config.allow_population_by_field_name
      • remove model.fields which was replaced by model.__fields__
      • remove model.to_string() which was replaced by str(model)
      • remove model.__values__ which was replaced by model.__dict__
    • Breaking Change: always validate only first sublevel items with each_item. There were indeed some edge cases with some compound types where the validated items were the last sublevel ones, #1933 by @​PrettyWood
    • Update docs extensions to fix local syntax highlighting, #2400 by @​daviskirk
    • fix: allow utils.lenient_issubclass to handle typing.GenericAlias objects like list[str] in python >= 3.9, #2399 by @​daviskirk
    • Improve field declaration for pydantic dataclass by allowing the usage of pydantic Field or 'metadata' kwarg of dataclasses.field, #2384 by @​PrettyWood
    • Making typing-extensions a required dependency, #2368 by @​samuelcolvin
    • Make resolve_annotations more lenient, allowing for missing modules, #2363 by @​samuelcolvin
    • Allow configuring models through class kwargs, #2356 by @​MrMrRobat
    • Prevent Mapping subclasses from always being coerced to dict, #2325 by @​ofek
    • fix: allow None for type Optional[conset / conlist], #2320 by @​PrettyWood

    ... (truncated)

    Changelog

    Sourced from pydantic's changelog.

    v1.8.1 (2021-03-03)

    Bug fixes for regressions and new features from v1.8

    v1.8 (2021-02-26)

    Thank you to pydantic's sponsors: @​jorgecarleitao, @​BCarley, @​chdsbd, @​tiangolo, @​matin, @​linusg, @​kevinalh, @​koxudaxi, @​timdrijvers, @​mkeen, @​meadsteve, @​ginomempin, @​primer-io, @​and-semakin, @​tomthorogood, @​AjitZK, @​westonsteimel, @​Mazyod, @​christippett, @​CarlosDomingues, @​Kludex, @​r-m-n for their kind support.

    Highlights

    Changes

    • Breaking Change, remove old deprecation aliases from v1, #2415 by @​samuelcolvin:
      • remove notes on migrating to v1 in docs
      • remove Schema which was replaced by Field
      • remove Config.case_insensitive which was replaced by Config.case_sensitive (default False)
      • remove Config.allow_population_by_alias which was replaced by Config.allow_population_by_field_name
      • remove model.fields which was replaced by model.__fields__
      • remove model.to_string() which was replaced by str(model)
      • remove model.__values__ which was replaced by model.__dict__
    • Breaking Change: always validate only first sublevel items with each_item. There were indeed some edge cases with some compound types where the validated items were the last sublevel ones, #1933 by @​PrettyWood
    • Update docs extensions to fix local syntax highlighting, #2400 by @​daviskirk
    • fix: allow utils.lenient_issubclass to handle typing.GenericAlias objects like list[str] in python >= 3.9, #2399 by @​daviskirk
    • Improve field declaration for pydantic dataclass by allowing the usage of pydantic Field or 'metadata' kwarg of dataclasses.field, #2384 by @​PrettyWood
    • Making typing-extensions a required dependency, #2368 by @​samuelcolvin
    • Make resolve_annotations more lenient, allowing for missing modules, #2363 by @​samuelcolvin
    • Allow configuring models through class kwargs, #2356 by @​MrMrRobat
    • Prevent Mapping subclasses from always being coerced to dict, #2325 by @​ofek
    • fix: allow None for type Optional[conset / conlist], #2320 by @​PrettyWood
    • Support empty tuple type, #2318 by @​PrettyWood
    • fix: python_requires metadata to require >=3.6.1, #2306 by @​hukkinj1

    ... (truncated)

    Commits
    • 619ff26 prepare for v1.8.1
    • 62bb2ad allow Config.field to update a Field (#2461)
    • 3f84d14 fix: validation with a BaseModel field and a custom root type (#2451)
    • ab69114 fix: avoid RecursionError when using some types like Enum or Literal wi...
    • 429b439 Allow for generation of a constrained float with multiple_of argument for hyp...
    • a74232e fix: variable length tuples of compound types (#2421)
    • 37c37fd fix(mypy): fix custom Path and UUID related types (#2420)
    • b2d3f33 refactor: set Pattern encoder in ENCODERS_BY_TYPE (#2444)
    • 9bd2da7 fix: docs indentation (#2448)
    • d619457 fix: docs indent (#2440)
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language
    • @dependabot badge me will comment on this PR with code to add a "Dependabot enabled" badge to your readme

    Additionally, you can set the following in your Dependabot dashboard:

    • Update frequency (including time of day and day of week)
    • Pull request limits (per update run and/or open at any time)
    • Automerge options (never/patch/minor, and dev/runtime dependencies)
    • Out-of-range updates (receive only lockfile updates, if desired)
    • Security updates (receive only security updates, if desired)
    dependencies security 
    opened by dependabot-preview[bot] 3
  • Set proper host in DB_CONNECTION in .env.example

    Set proper host in DB_CONNECTION in .env.example

    Now: DB_CONNECTION=postgres://postgres:postgres@localhost/postgres

    Expected: DB_CONNECTION=postgres://postgres:postgres@db/postgres

    The hostname for connection is the same as a service name, so this information is considered permanent.

    opened by funnydman 3
  • Bump fastapi from 0.73.0 to 0.78.0

    Bump fastapi from 0.73.0 to 0.78.0

    Bumps fastapi from 0.73.0 to 0.78.0.

    Release notes

    Sourced from fastapi's releases.

    0.78.0

    Features

    • ✨ Add support for omitting ... as default value when declaring required parameters with:

    • Path()

    • Query()

    • Header()

    • Cookie()

    • Body()

    • Form()

    • File()

    New docs at Tutorial - Query Parameters and String Validations - Make it required. PR #4906 by @​tiangolo.

    Up to now, declaring a required parameter while adding additional validation or metadata needed using ... (Ellipsis).

    For example:

    from fastapi import Cookie, FastAPI, Header, Path, Query
    

    app = FastAPI()

    @​app.get("/items/{item_id}") def main( item_id: int = Path(default=..., gt=0), query: str = Query(default=..., max_length=10), session: str = Cookie(default=..., min_length=3), x_trace: str = Header(default=..., title="Tracing header"), ): return {"message": "Hello World"}

    ...all these parameters are required because the default value is ... (Ellipsis).

    But now it's possible and supported to just omit the default value, as would be done with Pydantic fields, and the parameters would still be required.

    ✨ For example, this is now supported:

    from fastapi import Cookie, FastAPI, Header, Path, Query
    

    app = FastAPI()

    @​app.get("/items/{item_id}") def main( item_id: int = Path(gt=0), </tr></table>

    ... (truncated)

    Commits
    • 1876ebc 🔖 Release version 0.78.0
    • 1673b3e 📝 Update release notes
    • 1711403 📝 Update release notes
    • acab64b ✅ Add tests for required nonable parameters and body fields (#4907)
    • 0a8d687 📝 Update release notes
    • ca437cd 📝 Add docs recommending Union over Optional and migrate source examples (...
    • c5be1b0 📝 Update release notes
    • 9262fa8 ✨ Add support for not needing ... as default value in required Query(), Pat...
    • 31690dd 📝 Update release notes
    • 8b66b9c 🎨 Fix default value as set in tutorial for Path Operations Advanced Configura...
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies python 
    opened by dependabot[bot] 2
  • Bump alembic from 1.7.6 to 1.8.0

    Bump alembic from 1.7.6 to 1.8.0

    Bumps alembic from 1.7.6 to 1.8.0.

    Release notes

    Sourced from alembic's releases.

    1.8.0

    Released: May 31, 2022

    changed

    • [changed] [installation] Alembic 1.8 now supports Python 3.7 and above.

      References: #1025

    • [changed] [environment] The "Pylons" environment template has been removed as of Alembic 1.8. This template was based on the very old pre-Pyramid Pylons web framework which has been long superseded by Pyramid.

      References: #987

    feature

    • [feature] [typing] PEP 484 typing annotations have been added to the env.py and revision template files within migration templates. Pull request by Nikita Sobolev.

      References: #764

    usecase

    • [usecase] [operations] The op.drop_table() operation directive will now trigger the before_drop() and after_drop() DDL event hooks at the table level, which is similar to how the before_create() and after_create() hooks are triggered by the op.create_table() directive. Note that as op.drop_table() accepts only a table name and optional schema name, the Table object received by the event will not have any information within it other than the table name and schema name.

      References: #1037

    • [usecase] [commands] Added new token epoch to the file_template option, which will populate the integer epoch as determined by int(create_date.timestamp()). Pull request courtesy Caio Carvalho.

      References: #1027

    bug

    • [bug] [revisioning] Fixed issue where a downgrade using a relative revision would fail in case of multiple branches with a single effectively

    ... (truncated)

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies python 
    opened by dependabot[bot] 2
Owner
Nik
Student. Currently Elixir backend developer. Python/Rust/Elixir + some other
Nik
Backend Skeleton using FastAPI and Sqlalchemy ORM

Backend API Skeleton Based on @tiangolo's full stack postgres template, with some things added, some things removed, and some things changed. This is

David Montague 18 Oct 31, 2022
Minimal example utilizing fastapi and celery with RabbitMQ for task queue, Redis for celery backend and flower for monitoring the celery tasks.

FastAPI with Celery Minimal example utilizing FastAPI and Celery with RabbitMQ for task queue, Redis for Celery backend and flower for monitoring the

Grega Vrbančič 371 Jan 1, 2023
A simple docker-compose app for orchestrating a fastapi application, a celery queue with rabbitmq(broker) and redis(backend)

fastapi - celery - rabbitmq - redis -> Docker A simple docker-compose app for orchestrating a fastapi application, a celery queue with rabbitmq(broker

Kartheekasasanka Kaipa 83 Dec 19, 2022
FastAPI Admin Dashboard based on FastAPI and Tortoise ORM.

FastAPI ADMIN 中文文档 Introduction FastAPI-Admin is a admin dashboard based on fastapi and tortoise-orm. FastAPI-Admin provide crud feature out-of-the-bo

long2ice 1.6k Dec 31, 2022
Example app using FastAPI and JWT

FastAPI-Auth Example app using FastAPI and JWT virtualenv -p python3 venv source venv/bin/activate pip3 install -r requirements.txt mv config.yaml.exa

Sander 28 Oct 25, 2022
FastAPI Learning Example,对应中文视频学习教程:https://space.bilibili.com/396891097

视频教学地址 中文学习教程 1、本教程每一个案例都可以独立跑,前提是安装好依赖包。 2、本教程并未按照官方教程顺序,而是按照实际使用顺序编排。 Video Teaching Address FastAPI Learning Example 1.Each case in this tutorial c

null 381 Dec 11, 2022
🤪 FastAPI + Vue构建的Mall项目后台管理

Mall项目后台管理 前段时间学习Vue写了一个移动端项目 https://www.charmcode.cn/app/mall/home 然后教程到此就结束了, 我就总感觉少点什么,计划自己着手写一套后台管理。 相关项目 移动端Mall项目源码(Vue构建): https://github.com/

王小右 131 Jan 1, 2023
FastAPI on Google Cloud Run

cloudrun-fastapi Boilerplate for running FastAPI on Google Cloud Run with Google Cloud Build for deployment. For all documentation visit the docs fold

Anthony Corletti 139 Dec 27, 2022
FastAPI + Django experiment

django-fastapi-example This is an experiment to demonstrate one potential way of running FastAPI with Django. It won't be actively maintained. If you'

Jordan Eremieff 78 Jan 3, 2023
Auth for use with FastAPI

FastAPI Auth Pluggable auth for use with FastAPI Supports OAuth2 Password Flow Uses JWT access and refresh tokens 100% mypy and test coverage Supports

David Montague 95 Jan 2, 2023
FastAPI Boilerplate

FastAPI Boilerplate Features SQlAlchemy session Custom user class Top-level dependency Dependencies for specific permissions Celery SQLAlchemy for asy

Hide 417 Jan 7, 2023
fastapi-crud-sync

Developing and Testing an API with FastAPI and Pytest Syncronous Example Want to use this project? Build the images and run the containers: $ docker-c

null 59 Dec 11, 2022
JSON-RPC server based on fastapi

Description JSON-RPC server based on fastapi: https://fastapi.tiangolo.com Motivation Autogenerated OpenAPI and Swagger (thanks to fastapi) for JSON-R

null 199 Dec 30, 2022
FastAPI Skeleton App to serve machine learning models production-ready.

FastAPI Model Server Skeleton Serving machine learning models production-ready, fast, easy and secure powered by the great FastAPI by Sebastián Ramíre

null 268 Jan 1, 2023
row level security for FastAPI framework

Row Level Permissions for FastAPI While trying out the excellent FastApi framework there was one peace missing for me: an easy, declarative way to def

Holger Frey 315 Dec 25, 2022
FastAPI framework plugins

Plugins for FastAPI framework, high performance, easy to learn, fast to code, ready for production fastapi-plugins FastAPI framework plugins Cache Mem

RES 239 Dec 28, 2022
python fastapi example connection to mysql

Quickstart Then run the following commands to bootstrap your environment with poetry: git clone https://github.com/xiaozl/fastapi-realworld-example-ap

null 55 Dec 15, 2022
The template for building scalable web APIs based on FastAPI, Tortoise ORM and other.

FastAPI and Tortoise ORM. Powerful but simple template for web APIs w/ FastAPI (as web framework) and Tortoise-ORM (for working via database without h

prostomarkeloff 95 Jan 8, 2023
Ready-to-use and customizable users management for FastAPI

FastAPI Users Ready-to-use and customizable users management for FastAPI Documentation: https://frankie567.github.io/fastapi-users/ Source Code: https

François Voron 2.4k Jan 1, 2023