Very often we can have multiple Django apps each running celery and all this is installed on a single server. How do we isolate these separate app's celery workers? The answer is: Simple, if you use Rabbitmq as your broker.

Rabbitmq lets us to add multiple virtualhosts, so we can easily separate celery queues and the use different broker_url per our app, let's start:

Today while moving Django/PostgreSQL site between servers and importing an SQL dump into the new location I got a surprising error "ERROR: must be owner of extension plpgsql". I'm already used to PostgreSQL quirks so after a quick search I came to the following solution:

Login as postgres user and do:

If you want to access data from request object in your model form these two mixins will help you to do it easily:

Current version on Haystack (2.10) combined with Elasticsearch produces weird results when you want to sort search results on charfield, the issue has been reported here https://github.com/toastdriven/django-haystack/issues/866 and here: https://github.com/toastdriven/django-haystack/issues/569

I'm a big fan of fighting with Drupal's inefficiencies and bottlenecks. Most of these come from contrib modules. Everytime we install a contrib module we should be ready for surprises which come on board with the module.

To make haystack search pager place nicelly with other get parameters, we can do something like this:

To make Django messages look nice in your bootstrap 3 template you need two things:

Drupal Views offers us a cool feature: ajaxified pagers. When you click on a pager, it changes the page without reloading the main page itself and then scrolls to the top of the view. It works great, but sometimes you may encounter a problem: if you have a fixed header on your page (the one that stays on top when you scroll the page) it will overlap with the top of your view container thus scroll to top won't work preciselly correct and the header will cover the top part of your view.

Media and static files won't be served in devel mode untill you put this at the end of the main urls.py file:

Run this line in order to start Django project by using Two Scoops of Django Project Template

Pages

Subscribe to TimOnWeb RSS