18 Jan, 17

Note on installing Comodo Positive SSL on Nginx

Usualy, Comodo sends you an archive containing two files: example.crt and example.ca-bundle. In order to install your certificate on Nginx, you need to concatenate these two files at first:

1
  1. cat example.crt example.ca-bundle >> example.ssl-bundle.crt

Now, in Nginx config, link ssl_certificate property to resulting example ...

Read now
18 Jan, 17

Override Field Widget Attributes in a Django Form or How To Add Placeholder Attribute to Django Form Input

Let's say we have a contact form and we want to add placeholders to this form inputs so our rendered form has these cool input labels. How do we do that?

My form is a child of ContactForm class provided by the django_contact_form module (https://github.com/ubernostrum/django-contact-form). The ...

Read now
18 Jan, 17

Set Required and Optional Address Inputs for Address Field in Drupal 8

This one is dedicated to all my fellow Drupalers. There’s no better exercise for a brain than reading ancient chinese poetry taming Drupal 8. When I’m bored, I turn to Drupal!

Recently I got my Drupal 8 Address module updated and it turned out that from now on street address ...

Read now
12 Jan, 17

There's Wagtail CMS Admin Styleguide Available

In case you didn't know and always been wondering about the next wagtail admin icon class, there's Wagtail CMS admin styleguide which comes with core packages. To enable it just update your INSTALLED_APPS config:

1
2
3
4
5
  1. INSTALLED_APPS = [
  2. ...
  3. 'wagtail.contrib.wagtailstyleguide',
  4. ...
  5. ]

And you're ready to access the guide ...

Read now
25 Oct, 16

Add reCaptcha to your Drupal 7 forms programatically

If you want to add Google's reCaptcha (https://www.google.com/recaptcha/intro/index.html) to your Drupal 7 forms programmatically you need to follow these two steps:

1) Install and enable captcha (https://www.drupal.org/project/captcha) and recaptcha (https://www.drupal.org/project/recaptcha) modules. The best ...

Read now
07 Oct, 16

"Error loading MySQLdb module Reason: image not found" error fix in El Capitan Mac OS

If you use mysql database in your Django project and when you run runserver command and get an error message similar to this: "Error loading MySQLdb module Reason: image not found" that means your El Capitan struggles to find necessary libraries. 

The issue can be fixed with these two ...

Read now
16 Sep, 16

Installing cryptography (part of Scrapy) on Mac OS X

I'm leaving this tip as a note for myself, but I hope someone will find it useful too.

If you try to install Scrapy or cryptography on Mac OS X, your pip install will likely fail with the message similar to this:

1
2
3
4
5
6
7
8
9 ...
Read now
01 Aug, 16

Creating content blocks programmatically in Drupal 8

Let's picture this: you've created a custom content block type (let's say, Ad block) in your shiny new Drupal 8 installation and you want to automaticaly create a fresh new block of that type each time you create a taxonomy term (Ad group), so that every ad group has a ...

Read now
15 Apr, 16

JQuery.cookie in Drupal 7

A quick tip for all Drupalistas outhere: if you want to use jQuery.cookie in your project, you actually don't have to download and install the library. jQuery.cookie is a part of Drupal 7 and can be included as easy as typing: 

1
  1. drupal_add_library('system', 'jquery.cookie');

Wondering ...

Read now
09 Nov, 15

Default Search API Sorts Per View in Drupal 7

It's been a while since I've written a post here (especially, Drupal-related). But today I have something interesting to share.

There's a module called Search API sorts (https://drupal.org/project/search_api_sorts) that provides custom sorts and a global sort block for Search API. The module itself is ok, but ...

Read now