mirror of
https://github.com/healthchecks/healthchecks.git
synced 2026-04-25 06:55:53 +03:00
[GH-ISSUE #310] Bug: Deprecated function call breaking manage.py collectstatic --noinput #236
Labels
No labels
bug
bug
bug
feature
good-first-issue
new integration
pull-request
question
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/healthchecks#236
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @gganeshan on GitHub (Dec 3, 2019).
Original GitHub issue: https://github.com/healthchecks/healthchecks/issues/310
It seems like django deprecated
admin_staticwhich is causing the following exception when runningmanage.py collectstatic --noinputcommand.Is there a way to resolve this exception??
Some posts suggest uninstalling and reinstalling django which I tried with no luck.
Reference: https://django.readthedocs.io/en/2.2.x/releases/2.1.html#id2
@gganeshan commented on GitHub (Dec 3, 2019):
Figured a way to resolve this issue.
My containerized application installs a number of additional libraries, one of them being
django-auth-ldap.This library has an implicit constraint defined as
Django>=1.11so it installs Django v3.0 leading to this issue.I added a constraint to my pip install limiting Django version at <3.0 for now.
constraints.txtpip install django-auth-ldap -c constraints.txt@cuu508 commented on GitHub (Dec 4, 2019):
I plan to update the project to use Django 3 soon. So the above exception might become a problem again.
Just tried to reproduce the problem, but no luck so far. I installed Django==3.0.0 and ran
manage.py collectstatic --noinputbut no errors here...In what order did you install the libraries?
@gganeshan commented on GitHub (Dec 4, 2019):
Ack
First
pip3 install -r requirements.txt- whererequirements.txtis the same as https://github.com/healthchecks/healthchecks/blob/master/requirements.txtthen
pip3 install django-auth-ldapIn the first step I observed that Django 2.2.8 is installed as expected. However, in the second step it gets upgraded to Django 3.0.
Let me know if you are still not able to reproduce the issue.
@SuperSandro2000 commented on GitHub (Dec 4, 2019):
You didn't supply
--update? NormallyDjango>=1.11should be finde with 2.X. See https://github.com/django-auth-ldap/django-auth-ldap/blob/master/setup.cfg#L39@cuu508 commented on GitHub (Dec 5, 2019):
Still haven't managed to reproduce it. There's this bit in the traceback you posted:
admin_static.pyfile does not exist in Django 3. It only exists in Django 2.x (and is supposed to throw a deprecation warning).My hunch is that you have both Django 2.x and Django 3 intalled in different locations, and these are somehow getting mixed up. If you use virtualenv, maybe you have Django installed both globally and inside a virtualenv?
I've also sometimes had to manually remove outdated .pyc files – but if pip installation goes cleanly, pip should have taken care of that I think.
@gganeshan commented on GitHub (Dec 5, 2019):
My app is containerized so these steps are taking place during the build process.
As I mentioned earlier, when I run
pip3 install -r requirements.txtit installs django 2.2.8 as defined here and then when I runpip3 install django-auth-ldapit simply installs django 3.0 on top of it (without pip uninstalling django) which I believe is leading to this error.@cuu508 commented on GitHub (Dec 5, 2019):
Could you share the Dockerfile (with any sensitive or unrelated bits stripped out) you are using for building the container?
@gganeshan commented on GitHub (Dec 5, 2019):
no I did not.
I could clearly see in my build output that it was installing django 3.X (see below).
django install:
django-auth-ldap install:
@gganeshan commented on GitHub (Dec 5, 2019):
Sure will do in a few.
@SuperSandro2000 commented on GitHub (Dec 5, 2019):
I could reproduce it:
@gganeshan commented on GitHub (Dec 5, 2019):
thanks @SuperSandro2000
@cuu508 commented on GitHub (Dec 5, 2019):
@SuperSandro2000 I ran the same commands. Here's the output of pip3 commands:
Installing django-auth-ldap didn't trigger a Django update for me. I'm probably missing something obvious but not sure what it is...
@SuperSandro2000 commented on GitHub (Dec 5, 2019):
You are right. Can't read the output properly.