wemake-services / wemake-services/django-split-settings

Enable pylint and autocomplete support for IDEs

Open
#441 0 comments 5 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
1.2k
Forks
73
Avg merge
6h 3m
Merged PRs (30d)
3

Description

Hi,

after switching to django-split-settings, and setting up the project with examples supplied in the documentation I have a problem, because my pylint configuration is complaining about missing attributes inside settings module:

************* Module xxx
xxx.py:114:23: E1101: Module 'project.settings' has no 'DEBUG' member (no-member)

I also don't have autocomplete within PyCharm/VSCode.

Anything that I can do to import all of the settings when checking the code?

Here is my init.py inside settings module:

"""
This is a django-split-settings main file.
For more information read this:
https://github.com/sobolevn/django-split-settings
Default environment is `developement`.
To change settings file:
`DJANGO_ENV=production python manage.py runserver`
"""
from os import environ

from split_settings.tools import include
from split_settings.tools import optional

ENV = environ.get("DJANGO_ENV") or "development"

base_settings = [
    "components/django.py",
    "components/database.py",
    "components/emails.py",
    # Select the right env:
    f"environments/{ENV}.py",
    # Optionally override some settings:
    optional("environments/local.py"),
]

# Include settings:
include(*base_settings)

Looking forward for a reply! Have a good day! :)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the settings module init.py and the project.settings import shown in the issue, then inspect how split_settings.tools.include and optional assemble settings from components and environments. Reproduce the pylint and PyCharm/VSCode autocomplete behavior using the documented example. Done means imported settings such as DEBUG are recognized by pylint and IDE completion without breaking environment selection.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
developer-experience, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.