Skip to content

Needs sync_to_async in async context #440

Open
@HosseyNJF

Description

Describe the problem

When used in an async view, you need to access the object with a sync_to_async wrapper or this error will get raised:

SynchronousOnlyOperation: You cannot call this from an async context - use a thread or sync_to_async

Steps to reproduce

Create an async view in Django 3.1 and try to access an attribute of the config object.

System configuration

  • Django version: 3.1
  • Python version: 3.9
  • Django-Constance version: 2.8.0

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions