Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: django support #33

Open
cgthayer opened this issue Oct 10, 2017 · 4 comments
Open

Feature request: django support #33

cgthayer opened this issue Oct 10, 2017 · 4 comments

Comments

@cgthayer
Copy link

Django doesn't explicitly import, but does use a list of INSTALLED_APPS, which are analogous. Would be great to provide support for that, or at least for a list of additional modules to check. My current work-around is to create an django_imports.py and copy them in, so pigar can pick up the deps.

@velis74
Copy link

velis74 commented Nov 12, 2017

Agreed: I'm using django-bootstrap3 which is exclusively imported via template tags and this plugin is not detected at all. Additionally I also use djangocms-admin-style which isn't even imported via tags because it overrides default behaviour simply by being listed in INSTALLED_APPS.

This feature would be nice.

@velis74
Copy link

velis74 commented Nov 13, 2017

Additional: it also does not detect psycopg2 which is listed in DATABASES.
I guess a more complete (but not ultimate) list would be:
INSTALLED_APPS
MIDDLEWARE
TEMPLATES (BACKEND, OPTIONS / context_processors)
DATABASES (ENGINE)
AUTH_PASSWORD_VALIDATORS
REST_FRAMEWORK (DEFAULT_PERMISSION_CLASSES, DEFAULT_AUTHENTICATION_CLASSES, etc)
AUTHENTICATION_BACKENDS
EMAIL_BACKEND

I'd make a pull request if you can tell me where this code should be placed: settings.py is located by manage.py, from there it should simply be parsed for the configuration variables.

@damnever
Copy link
Owner

@velis74 Pull request welcome! You can start from here.

@damnever
Copy link
Owner

damnever commented Jun 22, 2023

pip install pigar==2.1.0 has introduced an experimental feature:

INSTALLED_APPS = [
 'name-it-a', 'name-it-b', # pigar: required-packages=package-name-a,package-name-b
 'name-it-c', # pigar: required-imports=import-name
]

I hope this helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants