yourlabs / django-autocomplete-light

A fresh approach to autocomplete implementations, specially for Django. Status: v4 alpha, v3 stable, v2 & v1 deprecated.
https://django-autocomplete-light.readthedocs.io
MIT License
1.8k stars 467 forks source link

autocomplete.css file missing in dal_legacy_static package #1188

Closed gamesbook closed 3 years ago

gamesbook commented 4 years ago

This follow-up comment was raised in #620 (which was already closed in 2019).

There is still one file missing in dal_legacy_static package. Can you please add the missing file and release a new package?

Missing file:admin/css/autocomplete.css

Source of required file: https://github.com/yourlabs/django-autocomplete-light/blob/master/src/dal_select2/widgets.py#L85

Required file itself from Django: https://github.com/django/django/blob/master/django/contrib/admin/static/admin/css/autocomplete.css

jpic commented 3 years ago

You don't have django.contrib.admin inside INSTALLED_APPS ?

gamesbook commented 3 years ago
INSTALLED_APPS = [
    # 3rd-party apps.
    'crispy_forms',
    'authtools',
    'django_extensions',
    'rest_framework',
    'django_select2',
    'dal',  # django-autocomplete-light
    'dal_select2',
    'dal_legacy_static',
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.humanize',
    'django.contrib.staticfiles',
]
jpic commented 3 years ago

Interesting, what happens when you run ./manage.py findstatic admin/css/autocomplete.css

gamesbook commented 3 years ago

No matching file found for 'admin/css/autocomplete.css'

jpic commented 3 years ago

What is your Django version ?

Can you also look if it's properly installed in its path ?

In manage.py shell, import django, and get django.path or django.file, this is your Django directory, can you find the autocomplete.css anywhere in there ?

jpic commented 3 years ago

Does findstatic find it when you copy django/contrib/admin/static/.* into one of the known-to-work static directories of your project ? (hopefully you have at least one)

Not a good solution, but would be interesting to add that into perspective.

gamesbook commented 3 years ago

I'll quote from the original issue #620 -

jpic commented on 22 Jan 2019

admin/css/vendor is supposed to be provided by django 2
however we could host a local copy for django < 2.0, if you think that could fix the issue ?

andybak commented on 22 Jan 2019

Yes. Just to need to think of a tidy way to handle forward and backwards compat.

How about keeping the "missing" files in a separate dal app: "dal_legacystatic" or similar?

The docs could then clearly state: "If you're using Django < 2.0 then add dal_legacystatic to installed apps."

So I am using version 1.11 (<2.0) and am assuming that this approach will work. But as noted:

TZanke commented on 8 May 2019

There is still one file missing in dal_legacy_static package. 

Can you please add the missing file and release a new package?

Missing file:admin/css/autocomplete.css

which has not been resolved; hence why I opened this issue.

jpic commented 3 years ago

Right, I'm surprised nobody made a PR yet