I still feel like a child regarding Django + pants...
# general
f
I still feel like a child regarding Django + pants ... while this is nice from one perspective it's also quite frustrating 😄 Are there more examples, talks, posts, documentation on how to migrate an existing Django codebase (which is not in best shape) to be driven by pants 👖 ? it feels like I need to understand the Django internals better than ever - especially about how settings are working and what it actually is - so, if someone has good resources related to this independently from 👖 I'd be thankful, too.
e
I'll just say your conclusion about learning how Django works is a good one. Pants aside even. Dig in and learn the magic there and everything gets easier to reason about.
Never offshore your learning.
f
not really easy to find good resources on the topic as it seems ... mostly is on the todo app tutorial level
but I guess nowadays the netz is also crowded with BS everyone wants to monetize
c
here’s a post by @clean-city-64472 about the experiences of migrating a legacy Django app over to use pants, in case you’ve not seen it: https://www.gordoncassie.com/pants-build-tool-with-django/ May have some interesting bits in it for you..
f
Nope didn’t has this yet, thx for the link
👍 1
so @enough-analyst-54434 is it even Django or simply how Python handles dependencies?
e
@freezing-fall-2672 no clue, but the point stands. If you understand both of those topics well, you probably are 90% to an answer.
👍 1
f
makes sense
can I have
pants fix-all-make-it-work
?
e
Yeah, seriously though that's the issue. Your question ratio relative to others is super high. That's a sign. In this case I think it's a sign you're juggling too many topics you're not sure of. I'd whittle those down and then circle back when you have just one variable to deal with.
f
yeah, that's true. You still have to account in, that I'm also always the person asking questions - like in presentations, discussions, etc - which turns out beneficial in a clear majority of cases 🙂 also I have to deal with lots of other stuff besides trying to make pants work for us, but that's just a sidenote...
@curved-television-6568 the blog post is nice to read and I will probably use some points in my argumentation. for my current approach there sadly too little details how they actually managed to migrate to pants - he's mentioning scripts based approach to copy from the source repo and fix things gradually. anyways, still nice to read, thx.
👍 1
c
I wasn’t there for the migration, but if you have specific questions I may be able to give some answers..
f
well, we have a setup with regular settings.py files, with one for tests with minor changes ... now I don't really understood yet how I'd adopt this to how pants isolates tests • A global setting file doesn't make much sense since it would bloat the sandboxes • For individual tests pants need some help to figure out what's needed to run the test I'm trying to solve this efficiently/properly - trying to get started as little as possible. also I've created this to better understand things https://github.com/elmcrest/example-django-multiple-monoliths-pantsbuild
h
Django uses a lot of magic, and some of it - naming conventions, runtime classloading via configured strings, resource discovery, and so on, interacts in interesting ways with Pants, particularly with dependency management, running tests, and packaging for deployment. As John has mentioned, it is important to understand Django's magic, regardless of Pants. You can grok the Django tutorial, or similar simple examples, without understanding too much of the magic, but to go beyond those basic cases you really do need to have a mental model of the details of how Django works. The idea that the Django framework abstracts away those details so you don't need to think about them does not hold up in real-world use, from my experience.
c
yea, getting around the bloating that comes with a Django app is still on our todo list here.. 😦