All posts filed under: Drupal

It’s all about drupal coding and whining.

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 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 […]

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 […]

Clear Varnish cache via PHP: a Drupal 7 proof of concept

Leave a comment
Coding / Drupal

Using Varnish as reverse proxy or proxy is an useful approach to reduce the load of webservers like Apache. In Drupal 7 I’ve to clear the varnish cache of a specific domain when Drupal caches are globally cleared. Drupal has the right hook invoked when cache are cleared: Now this piece of code simply adds the current domain to a ASCII text file on /var/www/varnishdomains2cleardir/varnishdomains2clear. Preparing the file to the write On CentOS you have […]

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 add: […]

Apache CentOS 6 cannot send email and Drupal get HTTP request status fails

comments 2
Drupal / Howtos / System Administration

I’m installing a Pressflow 6 on a new machine running CentOS 6. I’m using Apache MPM Worker with FastCGI. Then I get the classical e-mail error: Unable to send e-mail. Please contact the site administrator if the problem persists. Then I try to use sendmail: Where testmail is a file containing these lines: And i get the message. PHP cannot send email through apache! Trying a simple php script to send mail like drupal core […]

Pair view fields content on a Drupal 7 view quick howto

Leave a comment

Valid for: Drupal 7, Views 3. I have two multiple text fields on a Drupal 7 content type. I want to display those fields paired by delta in a view. Here the code I used in my module named mymodule.module. Thanks to hook_views_pre_render(). I use this piece of code to pair Youtube URLs and plain text description Ā for a JSON output generated via Views Datasource. Remember to disallow multiple values when adding these fields to […]