Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adminactions.min.css cannot be found #227

Closed
SeverinBuchser opened this issue Jan 8, 2024 · 0 comments
Closed

adminactions.min.css cannot be found #227

SeverinBuchser opened this issue Jan 8, 2024 · 0 comments
Labels

Comments

@SeverinBuchser
Copy link

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

  1. Create a new django project (django-admin startproject <project-name>) with the specified packages from the Pipfile.
  2. Add adminactions to the installed apps (see above).
  3. Add adminactions to the urls and actions.add_to_site(site) (see above).
  4. Run migrations, create a superuser and run the project.
  5. Create another user in django admin
  6. Go to /admin/auth/users, select both users and exectute the "Merge selected users" action.
  7. 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:

css = {"all": ["adminactions/css/adminactions.min.css"]}

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.

@saxix saxix added the bug label Jan 22, 2024
@saxix saxix closed this as completed in 3ad89dc Jan 31, 2024
saxix added a commit that referenced this issue Jan 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants