Django 1.6 and ckeditor uploading image - python

installed Django 1.6.1 over 1.5, update Pillow, PIL, django-ckeditor and django-ckeditor-updated, remove default from url. When I want to upload a picture I see this:
ImportError at /ckeditor/upload/
No module named image
Request Method: POST
Request URL: mysiteaddress/ckeditor/upload/?CKEditor=id_about&CKEditorFuncNum=1&langCode=en
Django Version: 1.6.1
Exception Type: ImportError
Exception Value:
No module named image
Exception Location: /usr/local/lib/python2.7/site-packages/ckeditor/image_processing.py in get_backend, line 10
Python Executable: /usr/local/bin/uwsgi
Python Version: 2.7.5
someone can help?

Along with trying collect static, you are not supposed to have django-ckeditor and django-ckeditor-updated in the same project. See installation notes.
https://github.com/shaunsephton/django-ckeditor#installation

Related

ImportError raised when trying to load 'rest_framework.templatetags.rest_framework': No module named urls

[INFO] oauth2client.client: Refreshing access_token
[ERROR] django.request: Internal Server Error: /
get_package_libraries
"trying to load '%s': %s" % (entry[1], e)
InvalidTemplateLibrary: Invalid template library specified. ImportError raised when trying to load 'rest_framework.templatetags.rest_framework': No module named urls
This is a python 2.7 project. Django version 1.9
Django Rest Framework 3.7 dropped support for Django 1.9.
Django 1.9 is end of life and does not get security fixes. You should really update to the current release 2.0 (requires Python 3) or the 1.11 LTS (supports Python 3 and Python 2).
If you must use Django 1.9, then you'll need to use an earlier version of rest framework.

Why newly created project doesn't display built-in API Django documentation?

I have a problem described in this post I have no idea what is the reason of the problem so I decided to create a new project both in Docker like without it. In both cases I get the same problem. To wit to newly created project I add only to urls.py:
from rest_framework.documentation import include_docs_urls
API_TITLE = 'API title'
API_DESCRIPTION = '...'
urlpatterns = [
url(r'^docs/', include_docs_urls(title=API_TITLE, description=API_DESCRIPTION))
]
and in Docker requirements.txt I add coreapi. In case of project without Docker I install via virtualenv pip3 install coreapi. That is all what in my opinion I should do in order to get a view like at the top of this site from documentation Obviously at http://localhost:8000/docs/ However in both cases I get
TemplateDoesNotExist at /docs/
rest_framework/docs/index.html
Django tried loading these templates, in this order:
Using engine django:
django.template.loaders.app_directories.Loader: /usr/local/lib/python3.6/site-packages/django/contrib/admin/templates/rest_framework/docs/index.html (Source does not exist)
django.template.loaders.app_directories.Loader: /usr/local/lib/python3.6/site-packages/django/contrib/auth/templates/rest_framework/docs/index.html (Source does not exist)
(in virtualenv there is only different path)
Does anyone have an idea what might be wrong? If more details will be needed I will add it immediately to this post, just let me know.
UPDATE
When I add rest_framowork to INSTALLED_APPS I get:
AttributeError at /docs/
'NoneType' object has no attribute 'items'
Request Method: GET
Request URL: http://localhost:8001/docs/
Django Version: 1.11
Exception Type: AttributeError
Exception Value:
'NoneType' object has no attribute 'items'
Exception Location: /usr/local/lib/python3.6/site-packages/rest_framework/templatetags/rest_framework.py in items, line 244
Python Executable: /usr/local/bin/python3
Python Version: 3.6.1
Python Path:
['/code',
'/usr/local/lib/python36.zip',
'/usr/local/lib/python3.6',
'/usr/local/lib/python3.6/lib-dynload',
'/usr/local/lib/python3.6/site-packages']
In template /Users/myUser/Projects/DjangoTest/lib/python3.6/site-packages/rest_framework/templates/rest_framework/docs/sidebar.html, error at line 8
UPDATE2
I have in my app on heroku rest_framowork at the top of INSTALLED_APPS however http://myapp.herokuapp.com/docs/ returns:
AttributeError at /docs/
'NoneType' object has no attribute 'items'
Request Method: GET
Request URL: http://myapp.herokuapp.com/docs/
Django Version: 1.11
Exception Type: AttributeError
Exception Value:
'NoneType' object has no attribute 'items'
Exception Location: /app/.heroku/python/lib/python3.6/site-packages/rest_framework/templatetags/rest_framework.py in items, line 244
Python Executable: /app/.heroku/python/bin/python
Python Version: 3.6.1
Python Path:
['/app/Project/backend/project',
'/app/.heroku/python/bin',
'/app',
'/app/.heroku/python/lib/python36.zip',
'/app/.heroku/python/lib/python3.6',
'/app/.heroku/python/lib/python3.6/lib-dynload',
'/app/.heroku/python/lib/python3.6/site-packages']
Server time: Mon, 17 Jul 2017 12:49:49 +0000
SOLTUION
I used djangorestframework==3.6.2 instead of djangorestframework==3.6.3 in requirements.txt. I have no idea why version 3.6.3 doesn't work.
This likely means that you didn't add rest_framework to the INSTALLED_APPS in the settings.py file.

Import Error, No Module named formats

This is the error I get! I'm guessing I'm missing a module named formats? I'm very new to installations with django. So bear with me. Previously I had gotten error that vectorformat.formats module was missing. So I did sudo pip install vectorformats. This lead to the error I have now. See below:
from vectorformats.formats import django, geojson
ImportError: No module named formats
Django Version: 1.6.1
Exception Type: ImportError
Exception Value:
No module named formats
Exception Location: /usr/local/lib/python2.6/dist-packages/leaflet_storage/views.py in , line 25
Python Executable: /usr/bin/python
Python Version: 2.6.6
from vectorformats.Formats import ...
note the uppercase 'F'
documentation here
you'll have the same error message with django and geojson

IOError - decoder jpeg not available - even after libjpeg-dev n PIL installation

I get this error when I try to access products or catelogue
I have installed libjpeg-dev and then pil.
I'm running the django_oscar sandbox locally. what should I do ?
Please also specify what additional info should I add ??
IOError at /catalogue/
decoder jpeg not available
Request Method: GET
Request URL: http://127.0.0.1:8888/catalogue/
Django Version: 1.4.6
Exception Type: IOError
Exception Value:
decoder jpeg not available
Exception Location: /home/vagrant/oscar/local/lib/python2.7/site-packages/PIL/Image.py in _getdecoder, line 385
Python Executable: /home/vagrant/oscar/bin/python
Python Version: 2.7.3
Python Path:
['/vagrant/projects/ecommerce/clone/django-oscar/sites/sandbox',
'/home/vagrant/oscar/local/lib/python2.7/site-packages/distribute-0.6.24-py2.7.egg',
'/home/vagrant/oscar/local/lib/python2.7/site-packages/pip-1.1-py2.7.egg',
'/vagrant/projects/ecommerce/clone/django-oscar',
'/home/vagrant/oscar/local/lib/python2.7/site-packages/django_treebeard-2.0b1-py2.7.egg',
'/home/vagrant/oscar/lib/python2.7',
'/home/vagrant/oscar/lib/python2.7/plat-linux2',
'/home/vagrant/oscar/lib/python2.7/lib-tk',
'/home/vagrant/oscar/lib/python2.7/lib-old',
'/home/vagrant/oscar/lib/python2.7/lib-dynload',
'/usr/lib/python2.7',
'/usr/lib/python2.7/plat-linux2',
'/usr/lib/python2.7/lib-tk',
'/home/vagrant/oscar/local/lib/python2.7/site-packages',
'/home/vagrant/oscar/local/lib/python2.7/site-packages/PIL']
If you're using ubuntu, there is a lovely blog post by the Oscar author about exactly this :)
http://codeinthehole.com/writing/how-to-install-pil-on-64-bit-ubuntu-1204/

Install django db log

I tried to install django db log from here https://github.com/dcramer/django-db-log, by running python setup.py install, but for some reason when I add the app to the settings.py file, it's not working. here's the error that I get:
Request Method: GET
Request URL: http://localhost:8000/admin/
Django Version: 1.3.1
Exception Type: ImportError
Exception Value:
cannot import name Paginator
Exception Location: /Library/Python/2.6/site-packages/django/utils/importlib.py in import_module, line 35
Python Executable: /usr/bin/python
Python Version: 2.6.1
Python Path:
['/Users/christopherfarm/Desktop/ecomstore',
'/Library/Python/2.6/site-packages/python_dateutil-1.5-py2.6.egg',
'/Library/Python/2.6/site-packages/MySQL_python-1.2.3-py2.6-macosx-10.6-universal.egg',
'/Library/Python/2.6/site-packages/django_db_log-2.2.1-py2.6.egg',
'/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python26.zip',
'/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6',
'/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/plat-darwin',
'/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/plat-mac',
'/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/plat-mac/lib-scriptpackages',
'/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python',
'/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/lib-tk',
'/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/lib-old',
'/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/lib-dynload',
'/Library/Python/2.6/site-packages',
'/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/PyObjC',
'/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/wx-2.8-mac-unicode']
Server time:
From the django-db-log's project page:
This project is no longer updated. Please see http://github.com/dcramer/django-sentry for its successor
So I simply assume that this project is not compatible with Django-1.3.1 due to various deprecations...

Categories