38👍
So after some research, it looks like the version 12.3
of sorl-thumbnail on PyPI and Github are different!
If you download the source directly from PyPI – you will find that the package doesn’t contain any migrations. This is the reason the table doesn’t exist even though you’ve run all the migrations.
On Github, the migration file for version 12.3
definitely exists.
You have three options:
- Create the table using
./manage.py syncdb
(only if you’re running Django 1.8 or below) - Install directly from Github for version
12.3
- Use version
12.4a1
of sorl-thumbnail which includes migrations
You can install from Github directly as follows:
pip install git+git://github.com/mariocesar/sorl-thumbnail@v12.3
sorl-thumbnail version 12.3 supports up to Django version 1.8, where the syncdb command still exists. If you’re running Django 1.8 or lower, you can create the missing table by running
python manage.py syncdb
53👍
If just
manage.py makemigrations
doesn’t create any migrations, try
manage.py makemigrations thumbnail
manage.py migrate
This will create migrations for thumbnail and then migrate them.
It works for me.
I am using Django 1.9 and sorl.thumbnail 12.3.
- [Django]-Django: show the count of related objects in admin list_display
- [Django]-How to format time in django-rest-framework's serializer?
- [Django]-How to add new languages into Django? My language "Uyghur" or "Uighur" is not supported in Django
1👍
Use version 12.3 of sorl-thumbnail. Follow this steps
Remove actual version
pip uninstall sorl-thumbnail
Install version 12.3
pip install git+git://github.com/mariocesar/sorl-thumbnail@v12.3
Migrations
python manage.py migrate
- [Django]-Nginx doesn't serve static
- [Django]-Django 1.7 – App 'your_app_name' does not have migrations
- [Django]-How do I deploy Django on AWS?
0👍
For me the error just occurred while executing dumpdata
.
So if you find this thread here because you tried to use dumpdata
, then excluding the thumbnail app will probably be an easy workaround for you:
python manage.py dumpdata --exclude thumbnail
Of course you should follow the other answers, if you want to have your Django clean.
- [Django]-Django apps aren't loaded yet when using asgi
- [Django]-Django: Open uploaded file while still in memory; In the Form Clean method?
- [Django]-Add rich text format functionality to django TextField