boxine / django-huey-monitor

Django based tool for monitoring huey task queue: https://github.com/coleifer/huey
GNU General Public License v3.0
88 stars 20 forks source link

Issue with ManifestStaticFilesStorage due to TaskModelAdmin referencing non-existent CSS file #55

Closed henribru closed 2 years ago

henribru commented 2 years ago

TaskModelAdmin references a CSS file called huey_monitor.css. This file doesn't actually exist, which causes problems if you're using Django's ManifestStaticFilesStorage or something inheriting from it like Whitenoise's CompressedManifestStaticFilesStorage. Specifically you end up with a ValueError and a 500 when navigating to the admin task list in production, unless you tweak the manifest_strict setting. I'm not sure if this CSS thing is leftover from something or if it's meant to be an optional file that can be added by users of the library to customize how the Huey admin looks. In the former case, could we remove it so that we don't have to disable manifest_strict? In the latter case, is disabling manifest_strict the intended workaround for this issue?

henribru commented 2 years ago

Actually it turns out disabling manifest_strict doesn't fix this issue, at least not when using Whitenoise. You end up with another ValueError, "The file 'huey_monitor.css' could not be found with <whitenoise.storage.CompressedManifestStaticFilesStorage object at 0x7f47401bfd60>."

jedie commented 2 years ago

Hm. I didn't understand the real problem... Maybe you missed to run collectstatic ?!?

huey_monitor.css is a part of huey_monitor.admin.TaskModelAdmin.Meta.css, so that collectstatic will copy this file to the right place... What did i miss here?!?

henribru commented 2 years ago

I am running collectstatic, but that's not copying a huey_monitor.css to ./staticfiles/css. There doesn't seem to be a huey_monitor.css file in this repository for it to copy?

jedie commented 2 years ago

Whoops. I understand now. Fixed by #66 Released as v0.4.4

henribru commented 2 years ago

Thanks :+1: