Hello again - One more question. In django, everyt...
# general
c
Hello again - One more question. In django, everything seems to be correctly set up, when running shell (e.g.
./pants run backend/modules/mod1:manage -- shell
). However when I do runserver (e.g.
./pants run backend/modules/mod1:manage -- runserver
) it complains that django is not installed. (No module found...) Any idea why? it seems to disregard all installed side-packages...
h
There is a gotcha with
runserver
because the Django development server’s autoreloading logic does some syspath hacks that don’t interact well with pants’s sandboxing.
The solution is to do
runserver --noreload
And let Pants do the reloading
which it does more precisely anyway
Writing a Django-specific tutorial with this sort of stuff in it is on my todo list…
(to let Pants do the reloading set
restartable=True
on the pex_binary target that wraps
manage.py
)
c
Okay that works, thatnk @happy-kitchen-89482
However, why doesn't the django example need this norelead flag?
Found it ... It uses norelead under the hood due to custom manage.py...
h
Ah yes, lots of hackery…
Sorry, this is poorly documented
We really should have a Django page in the docs
c
All good - I was just very very confused 😄
i
Oh wow. We spent days trying to fix this 😅
Thanks for the help!