adminactions.min.css cannot be found
SeverinBuchser opened this issue · 0 comments
SeverinBuchser commented
Hello
For the merge action, the adminactions.min.css
cannot be found (I get a 404).
OS: macOS Sonoma Version 14.2.1
Pipfile
:
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"
[packages]
django-adminactions = "==2.3.0"
django = "==5.0.1"
[dev-packages]
[requires]
python_version = "3.11"
settings.py
:
...
INSTALLED_APPS = [
"django.contrib.admin",
"django.contrib.auth",
"django.contrib.contenttypes",
"django.contrib.sessions",
"django.contrib.messages",
"django.contrib.staticfiles",
"adminactions"
]
...
urls.py
:
from django.contrib import admin
from django.urls import include, path
from django.contrib.admin import site
from adminactions import actions
actions.add_to_site(site)
urlpatterns = [
path("admin/", admin.site.urls),
path("adminactions/", include("adminactions.urls")),
]
Reporduction Steps
- Create a new django project (
django-admin startproject <project-name>
) with the specified packages from thePipfile
. - Add
adminactions
to the installed apps (see above). - Add
adminactions
to the urls andactions.add_to_site(site)
(see above). - Run migrations, create a superuser and run the project.
- Create another user in django admin
- Go to
/admin/auth/users
, select both users and exectute the "Merge selected users" action. - Now you should see
GET http://127.0.0.1:8000/static/adminactions/css/adminactions.min.css net::ERR_ABORTED 404 (Not Found)
in the console.
Propbable Cause
I assume this is because in the source I found this line:
But as far as I see, no adminactions.min.css
actually exists in the static files. I think this line should be
css = {"all": ["adminactions/css/adminactions.css"]}
This file actually exists.
Workaround
For now i solved the issue by creating a static file static/adminactions/css/adminactions.min.css
and copied the contents of static/adminactions/css/adminactions.css
into the new file.