All posts filed under: django

PIL: ord() expected a character, but string of length 0 found (SOLVED)

Leave a comment
django / Howtos / Python
PIL error

Using Django, and easy_thumbnails coupled with Pillow specifically I’m stumbled upon this error in PIL.ImageFile on PIL/_binary.py: ord() expected a character, but string of length 0 found This python error was so frequent I’ve done some research, coming up with nothing. I’ve checked current Pillow version with: Getting: Pillow==3.0.0 Then I’ve upgraded the Pillow package with this: The sofware was updated to the very last version (5.0.0) without any issue on easy_thumbnails backend or frontend. […]

Why you should not use Drupal anymore

Leave a comment
Coding / django / Drupal / Python

I’ve started using Drupal on 2007. For about 9 years I visits drupal.org almost on daily basis, I released a module, I suggested some patches, participated to local events and so on. I’ve started working on Drupal with Drupal 5 and I ended on Drupal 7 with a long time on Drupal 6. In the meantime, Acquia was created to support Drupal development and make some money from the project and for the project in […]

Reduce Time to the First Byte – TTFB on web applications

Leave a comment
Coding / django / Python
A typical web application

How to speed up the time to the first byte and what are the causes of a long TTFB? Main causes are network and server-side and I will focus on server-side causes. I’m not covering any CMS here but you can try to apply some of these techniques starting from how to interpret the browser Timing. Get reliable timing Take a website with cache enabled: at the 9th visit on a page you can be […]

From Drupal to Django: how to migrate contents

Leave a comment
Coding / django / Drupal / Howtos / Python

In a recent article I explain the motivations for an upgrade from a no longer maintained Drupal 6 installation to Django 1.8. I will now cover more in detail the migration techniques adopted in the upgrade and I’ll deepen the models and the relationships. Structure If you’re a drupaler, you’re familiar with the node/NID/edit and the node/add/TYPE pages: Here we have two visible fields: Title and Body. One is an input type text and the other a […]

Guide to migrate a Drupal website to Django after the release of Drupal 8

comments 2
django / Drupal / Howtos

I maintain a news website written in Drupal since 2007. It is a Drupal 6, before was a 5. I made many Drupal 7 installations in these years and I went to three Drupal local conventions. This is a guide on how to abandon Drupal if you already knows some basics of Django and Python. Drupal on LAMP: lessons learned PHP is for (not so) fast development but maintainability can be a pain. Drupal try to overcome PHP limits, with […]

Django and Drupal integration using drush via SSH

Leave a comment
django / Drupal / Howtos / Python

Some months ago I talked about how to achieve a unified login from Django to Drupal using drush. The basic assumption was that both Drupal and Django are on the same server. What if the two components are on different servers? Paramiko is a SSH2 protocol library aimed to provide simple classes to make SSH connection. Let’s see how the code to call drush on command line changes. Prerequisites: paramiko on your app settings.py add: […]

Django development on Virtualbox: step by step setup

Leave a comment
Coding / django / Howtos / Python

I had a bad morning trying to repair my Cygwin installation from a virtualenv mess. It’s time to get a Debian and install it on a Virtualbox for my new django project! Windows: host Debian: guest Choosing the distro: what I want Python 2.6 Django 1.4 Apache + Mysql I’m a Debian fan from years so I go to the Debian website and download Wheezy netinst iso (32 bit, since I’m on a 32 bit OS […]