1

What is the generally accepted way for isolating functionality that is shared between multiple management commands in a given app? For example, I have some payload building code that is used across multiple management commands that access a third-party API. Is the proper location app_name/manangement/helpers.py which would then be imported in a management command with from ..helpers import build_api_payload?

I don't want to put it at the root of the app (we typically use app_name/helpers.py for shared functionality), since it pulls in dev dependencies that wouldn't exist in production, and is never really used outside the management command anyways.

1 Answer 1

1

I went with app_name/manangement/helpers.py. No issues.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.