Skip to content

python examples: Django preload and Flask gunicorn commands fail as documented #86

Done

Description

@akosidencio

Two Python framework examples in sdks/python/examples/ fail as documented (reproduced while verifying the 0.2.0 README; the README itself gives the correct guidance):

  1. Django under gunicorn --preload with examples/gunicorn.conf.py: AppConfig.ready() creates the client in the master, so flags.start() in post_fork returns the inherited client, and the worker raises CheckgateForkError on first evaluation.
  2. Flask: the documented gunicorn 'flask_app:create_app()' fails to boot when run from examples/. gunicorn auto-loads ./gunicorn.conf.py, whose post_fork imports Django, and that raises ImproperlyConfigured.

Acceptance criteria

  • With preload, the Django example creates the client only in workers (post_fork), never in the master.
  • The Flask example's documented command boots from examples/ (separate gunicorn config per framework, or an explicit -c).
  • sdks/python/tests/test_examples.py runs both under gunicorn -w 2 --preload and evaluates a flag in each worker.

Activity

  1. added this to the v0.2.1 milestone on Nov 22, 2026
  2. added
    bug
    on Nov 22, 2026
  3. added a commit that references this issue on Nov 30, 2026
  4. akosidencio commented on Nov 30, 2026

    @akosidencio
    MemberAuthor

    Fixed in 0.2.1 by #96 (merged to dev; part of the 0.2.1 release).

    Verification: Both examples tested under gunicorn -w 2 --preload in CI.

    Details are in the 0.2.1 changelog.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions