hey y'all :wave: long time listener first time cal...
# general
c
hey y'all šŸ‘‹ long time listener first time caller can anybody point me to any simple examples of pants configuration with a monorepo containing multiple django apps? I'm losing my mind. Thanks!
šŸ‘‹ 3
c
Pants has this very basic django example: https://github.com/pantsbuild/example-django
I’m not aware of any other public Django app using pants at the moment, but maybe the community here can fill me in šŸ˜‰
c
the biggest issue I'm having is with how DJANGO_SETTINGS_MODULE gets loaded (a very annoying thing in django.) using pants run / pants test always executes from the repo root, which is messing with the relative module syntax used to specify the settings module ("myapp.settings", etc). I fixed this for most things by going into manage.py (core django command execution file) and adding code that adds the parent to PYTHONPATH and changes the working directory, and also adding something like
Copy code
pex_binary(
    name="manage",
    entry_point="manage.py",
)
to the build file so I can call manage,py from pants run. so now when I execute something with manage.py it works fine, but running pants test to execute pytests everything just blows up again.
seems to be that depending on if something is running from pants cache or via a call from django it resolves differently. so it's almost like the syntax would have to always be relative and figure out where it's executing from, etc.