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

easy-thumbnails < 2.4 breaks in Django 1.11 #977

Closed
akshaybabloo opened this issue May 15, 2017 · 21 comments
Closed

easy-thumbnails < 2.4 breaks in Django 1.11 #977

akshaybabloo opened this issue May 15, 2017 · 21 comments

Comments

@akshaybabloo
Copy link

akshaybabloo commented May 15, 2017

easy-thumbnails<2.4 breaks in Django 1.11 and above. I get the following error:

Traceback (most recent call last):
  File "manage.py", line 22, in <module>
    execute_from_command_line(sys.argv)
  File "C:\Users\aksha\Anaconda3\envs\root35\lib\site-packages\django\core\management\__init__.py", line 363, in execute_from_command_line
    utility.execute()
  File "C:\Users\aksha\Anaconda3\envs\root35\lib\site-packages\django\core\management\__init__.py", line 337, in execute
    django.setup()
  File "C:\Users\aksha\Anaconda3\envs\root35\lib\site-packages\django\__init__.py", line 27, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "C:\Users\aksha\Anaconda3\envs\root35\lib\site-packages\django\apps\registry.py", line 108, in populate
    app_config.import_models()
  File "C:\Users\aksha\Anaconda3\envs\root35\lib\site-packages\django\apps\config.py", line 202, in import_models
    self.models_module = import_module(models_module_name)
  File "C:\Users\aksha\Anaconda3\envs\root35\lib\importlib\__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 986, in _gcd_import
  File "<frozen importlib._bootstrap>", line 969, in _find_and_load
  File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 673, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 665, in exec_module
  File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
  File "C:\Users\aksha\Anaconda3\envs\root35\lib\site-packages\easy_thumbnails\models.py", line 6, in <module>
    from easy_thumbnails import utils, signal_handlers
  File "C:\Users\aksha\Anaconda3\envs\root35\lib\site-packages\easy_thumbnails\utils.py", line 15, in <module>
    from easy_thumbnails.conf import settings
  File "C:\Users\aksha\Anaconda3\envs\root35\lib\site-packages\easy_thumbnails\conf.py", line 334, in <module>
    settings = Settings()
  File "C:\Users\aksha\Anaconda3\envs\root35\lib\site-packages\easy_thumbnails\conf.py", line 21, in __init__
    super(AppSettings, self).__init__(*args, **kwargs)
TypeError: __init__() missing 1 required positional argument: 'settings_module'

You might want to update the dependencies.

Update

If you update the package, Django-filer generates the thumbnails but does not show it on the admin page.

@esplinr
Copy link

esplinr commented Jun 21, 2017

I confirm this bug. I see the same behavior. My environment:

  • Fedora 25
  • Python 3.5
  • django-filer 1.2.7

manage.py migrate filer produced the error above when easy-thumbnails was 2.3, and ran successfully when easy-thumbnails was 2.4.1.

@BrianWClausen
Copy link

I had the same issue on a fresh install of Django 1.11.2. With easy_thumbnails 2.4.1 the thumbnails are no longer shown in the admin section.

@billyeh
Copy link

billyeh commented Jun 22, 2017

@BrianWClausen I don't know if this helps or not, but I read this on their documentation.

For easy_thumbnails to support retina displays (recent MacBooks, iOS) add to settings.py:

THUMBNAIL_HIGH_RESOLUTION = True

If you forget this, you may not see thumbnails for your uploaded files. Adding this line and refreshing the admin page will create the missing thumbnails.

@BrianWClausen
Copy link

@billyeh

It should only render the images in a higher resolution, but I did test it and unfortunately it did not work.

@ebertti
Copy link

ebertti commented Jul 17, 2017

I have the same problem

@stefanfoulis
Copy link
Contributor

Looks like this was fixed in easy-thumbanils 2.4.1: SmileyChris/easy-thumbnails#459
Please re-open if this is still an issue.

@akshaybabloo
Copy link
Author

@stefanfoulis I know that but the problem is when I manually update it the generated thumbnail is not visible in the admin page. That's what I said when I opened this ticket see my update. Also I can't reopen the ticket, you might have to reopen it.

@stefanfoulis stefanfoulis reopened this Jul 26, 2017
@stefanfoulis
Copy link
Contributor

@akshaybabloo do you get any useful error in the console if you set FILER_DEBUG=True?
Depending on your storage backend (e.g with S3) easy-thumbnails will cache the existence of thumbnails in the DB, so might not generate them if the DB tables contain entries. If that is the case you can empty all the easy-thumbnails tables.

@akshaybabloo
Copy link
Author

akshaybabloo commented Jul 28, 2017

@stefanfoulis I flushed my DB, but nothing seems to change. I think I know where the problem is (I guess).

I was looking at the easy_thumbnails_thumbnail table and this is what I have in it

gollahalli_com_django_test=> SELECT * FROM public.easy_thumbnails_thumbnail
gollahalli_com_django_test-> ORDER BY id ASC;
 id |           storage_hash           |                                                                           name                                                                           |           modified            | source_id
----+----------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------+-----------
  1 | f9bde26a1556cd667f742bd34ec7c55e | filer_public_thumbnails\filer_public/1e/38/1e389fa5-c6a2-4661-bdd2-325924288a7d\akshay_award.jpg__32x32_q85_crop_subsampling-2_upscale.jpg               | 2017-07-28 15:10:05.444394+12 |         1
  2 | f9bde26a1556cd667f742bd34ec7c55e | filer_public_thumbnails\filer_public/1e/38/1e389fa5-c6a2-4661-bdd2-325924288a7d\akshay_award.jpg__16x16_q85_crop_subsampling-2_upscale.jpg               | 2017-07-28 15:10:05.483498+12 |         1
  3 | f9bde26a1556cd667f742bd34ec7c55e | filer_public_thumbnails\filer_public/1e/38/1e389fa5-c6a2-4661-bdd2-325924288a7d\akshay_award.jpg__64x64_q85_crop_subsampling-2_upscale.jpg               | 2017-07-28 15:10:05.520095+12 |         1
  4 | f9bde26a1556cd667f742bd34ec7c55e | filer_public_thumbnails\filer_public/1e/38/1e389fa5-c6a2-4661-bdd2-325924288a7d\akshay_award.jpg__48x48_q85_crop_subsampling-2_upscale.jpg               | 2017-07-28 15:10:05.552682+12 |         1
  5 | f9bde26a1556cd667f742bd34ec7c55e | filer_public_thumbnails\filer_public/1e/38/1e389fa5-c6a2-4661-bdd2-325924288a7d\akshay_award.jpg__180x180_q85_crop_subsampling-2_upscale.jpg             | 2017-07-28 15:10:05.600308+12 |         1
  6 | f9bde26a1556cd667f742bd34ec7c55e | filer_public_thumbnails\filer_public/1b/-- More  --

If you look at the name field shouldn't \ be /?

@stefanfoulis
Copy link
Contributor

@akshaybabloo yeah, that might be the problem, it should be a forward slash. Maybe there is a bug in django-filer (or other involved library) somewhere that uses the filesystem seperator instead of always using / for building the path. I see from the paths in your traceback that you are on windows, which would have a default fileystem path seperator of \.

@stefanfoulis
Copy link
Contributor

note to self: setup CI for windows (#1004)

@akshaybabloo
Copy link
Author

Maybe this is not an issue on Linux. I haven't checked it

@racitup
Copy link

racitup commented Sep 15, 2017

When running pip check I'm getting a dependency problem.. does this need to be fixed too?

$ pip check
django-filer 1.2.8 has requirement easy-thumbnails<2.4,>=1.0, but you have easy-thumbnails 2.4.1.

Also note that there is a bug in easy-thumbnails==2.4.1 (SmileyChris/easy-thumbnails#450) so you will probably want to get the master or 2.4.2 when released

@horejsek
Copy link

Any update about this issue?

@racitup
Copy link

racitup commented Oct 25, 2017

2.4.2 is released, have you tried that?

@horejsek
Copy link

easy-thumbnails==2.4.2 is released but Django Filer is available still in version 1.2.8 with dependency less than 2.4. I see that in master is already updated dependency... maybe it could be released to PyPI as well?

@horejsek
Copy link

Oh, sorry, it's in branch develop, not master. I haven't noticed that master is not default.

@racitup
Copy link

racitup commented Oct 25, 2017

I'm using filer 1.2.8 with 2.4.2.. I think they just forgot to change the dependency..

@stefanfoulis
Copy link
Contributor

I'll try to make a release sometime this week.

@yakky
Copy link
Member

yakky commented Nov 4, 2017

Fixed by #1015

@yakky yakky closed this as completed Nov 4, 2017
@LepkoQQ
Copy link

LepkoQQ commented Nov 4, 2017

I just wanted to provide some more information for other people who encountered this issue.

I updated filer to 1.3.0 (and easy_thumbnails to 2.4.2) and that did NOT fix the thumbnails in the admin interface.

After that I decided to remake the whole virtual environment from scratch and suddenly the thumbs were fixed.

I ran pip freeze on both old and new venv and you can see the diff here:
https://gist.github.com/LepkoQQ/e37ea157edb2f68b38eaeac6e8c74c34/revisions#diff-b4ef698db8ca845e5845c4618278f29a

I can only speculate that one of these dependencies was to blame but i don't know much more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants