Feature: Support check BK_IAM_MIGRATION_APP_NAME settings#44
Open
uddmorningsun wants to merge 1 commit intoTencentBlueKing:masterfrom
Open
Feature: Support check BK_IAM_MIGRATION_APP_NAME settings#44uddmorningsun wants to merge 1 commit intoTencentBlueKing:masterfrom
uddmorningsun wants to merge 1 commit intoTencentBlueKing:masterfrom
Conversation
homholueng
suggested changes
Sep 29, 2021
iam/contrib/iam_migration/management/commands/iam_makemigrations.py
Outdated
Show resolved
Hide resolved
Since pip installation need `BK_IAM_MIGRATION_APP_NAME` according to docs/usage.md -> IAM Migration -> Django Migration. If not finding `BK_IAM_MIGRATION_APP_NAME`, will fail for `apps.get_app_config` since `MIGRATION_APP_NAME = getattr(settings, "BK_IAM_MIGRATION_APP_NAME", APP_NAME)` in `iam/contrib/iam_migration/conf.py` It's required to pay attention to different sitepackages directory in different Debian/... Distro: ``` >>> import site >>> site.getsitepackages() ['/usr/local/lib/python3.6/dist-packages', '/usr/lib/python3/dist-packages', '/usr/lib/python3.6/dist-packages'] >>> import iam >>> iam.__file__ '/usr/local/lib/python3.6/dist-packages/iam/__init__.py' $ python3 -m venv /tmp/venv >>> import site >>> site.getsitepackages() ['/tmp/venv/lib/python3.6/site-packages', '/tmp/venv/local/lib/python3.6/dist-packages', '/tmp/venv/lib/python3/dist-packages', '/tmp/venv/lib/python3.6/dist-packages'] >>> import iam >>> iam.__file__ '/tmp/venv/lib/python3.6/site-packages/iam/__init__.py' ``` Signed-off-by: Chenyang Yan <memory.yancy@gmail.com>
Author
|
@homholueng FYI, this PR not only support check
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Making Django load custom app to make advantage of AppConfig.label attribute.
Signed-off-by: Chenyang Yan memory.yancy@gmail.com