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

path info according to `__file__`

Open
#223 4 comments 0 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,

Above all, thank you for sharing this great package.
I have a setting according to the __file__, but the file location is not based on the file itself, but the include calling file. For example, when I have setting files as:

settings.__init__.py
settings/components/__init__.py
settings/components/common.py
settings/components/others.py

and if assume that include is calling components/common.py that contains the __file__ based setting. I expected the __file__ == settings/components/common.py but the actual value is settings.__init__.py.

if I have another setting in components/others.py and need to import from settings.components.common import VARS where the VARS is the setting based on __file__, then the value of the VARS becomes different.

Can I have any hint to solve this conflict? Thank you!

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

Reproduce the reported behavior using the settings layout shown: settings.init.py, settings/components/common.py, and settings/components/others.py. Start by tracing how include handles file when common.py is loaded, then verify whether importing VARS from others.py preserves the expected path-specific value. Done means the intended behavior is documented or the path resolution is corrected and covered by a regression test.

Written by the indexing model from the issue text.

Assessment

Tech stack
django, python
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.