Skip to content

How to debug inside pycharm ? #517

Description

@masoodkazemi94

Hi to every one,
I want to debug with PyCharm debugger run my tests and see all variables and traces. but it seems it didn't load the .env file so I have an error that some critical environment variable is missing (note that I don't want to use docker to run my tests).
here some error that I got:

ImportError while loading conftest '/home/has/project/backend/app/app/tests/conftest.py'.
../conftest.py:7: in <module>
    from app.core.config import settings
../../core/config.py:90: in <module>
    settings = Settings()
pydantic/env_settings.py:39: in pydantic.env_settings.BaseSettings.__init__
    ???
pydantic/main.py:341: in pydantic.main.BaseModel.__init__
    ???
E   pydantic.error_wrappers.ValidationError: 11 validation errors for Settings
E   SERVER_NAME
E     field required (type=value_error.missing)
E   SERVER_HOST
E     field required (type=value_error.missing)
E   PROJECT_NAME
E     field required (type=value_error.missing)
E   SENTRY_DSN
E     object of type 'NoneType' has no len() (type=type_error)
E   POSTGRES_SERVER
E     field required (type=value_error.missing)
E   POSTGRES_USER
E     field required (type=value_error.missing)
E   POSTGRES_PASSWORD
E     field required (type=value_error.missing)
E   POSTGRES_DB
E     field required (type=value_error.missing)
E   SQLALCHEMY_DATABASE_URI
E     can only concatenate str (not "NoneType") to str (type=type_error)
E   FIRST_SUPERUSER
E     field required (type=value_error.missing)
E   FIRST_SUPERUSER_PASSWORD
E     field required (type=value_error.missing)

If anybody can help me I will appreciate it.
thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions