MicroPyramid
Blog


LATEST BLOGS

How to index binary files in django haystack

Posted On 27 September 2013 By MicroPyramid

Now we are going to index text content which is stored in structured files such as PDFs, Microsoft Office documents, images, etc using haystack and sorl's

In order to read and store the data, we can use SearchBackend.extract_file_contents(self, file_obj) method. It takes the file object, returns a dictionary containing two keys: metadata and contents. The contents value will be a string containing all of the text which the backend managed to extract from the file contents.

Generating PDF Files in Python using xhtml2pdf

Posted On 28 August 2013 By MicroPyramid

There are many ways for generating PDF in python. In this post I will be presenting PDF files generation with xhtml2pdf.

xhtml2pdf: xhtml2pdf is a HTML/CSS to PDF converter written in Python and therefore platform independent. xhtml2pdf supports for frameworks like Django and simple integration into Python programs. It is also usable as stand alone command line tool.

pisa: pisa is a html2pdf converter using the ReportLab Toolkit, the HTML5lib and pyPdf.

Understanding django serializers with examples

Posted On 14 August 2013 By MicroPyramid

Serializers are used for “translating” Django models into other formats like xmi,json,yaml(YAML Ain’t a Markup Language)

from django.core import serializers
data = serializers.serialize("xml", SomeModel.objects.all())

Introduction to Django's Class based views - Understanding how a class based view works

Posted On 27 July 2013 By MicroPyramid

Django has MVT architecture. A view in django is just a callable that takes a request and returns a response. But this can be more than just a function, that contains the actual business logic of an URL. In addition to normal funcation based views Django provides of some classes which can be used as views. These allow you to structure your views and reuse code by inheriting them.

Using Python xlwt generating CSV writer and Excel files

Posted On 06 July 2013 By MicroPyramid

In most of the cases, you need to export the data from your database to different formats. In this post I will show you how to create functions in your Django applications which export data as files. Here I will be covering the mostly used formats: CSV and Excel.

Django Hosting on Amazon EC2 with wordpress on same domain

Posted On 16 June 2013 By MicroPyramid

Configuring the Wordpress as subdirectory can be tricky. In this tutorial we will Setup a Django Website alongside a wordpress blog.

Understanding Django Permissions And Groups

Posted On 06 June 2013 By MicroPyramid

Django comes with a simple permissions system. It provides a way to assign permissions to specific users and groups of users. We can have permissions for add, edit, deleting a model.

Django permissions are of 2 types:
1.Model level permissions
2.object level permissions

Celery With Supervisor

Posted On 12 May 2013 By MicroPyramid

Celery is a task queue with focus on real-time processing, while also supports task scheduling. Task queues are used as mechanisms to distribute work across multiple threads or machines. A task queues input is a unit of work called a task,dedicated worker processes and constantly moniter the queue for new work to perform. Celery communicates via messages using a broker to mediate between workers and clients.

Django Inclusion Tags

Posted On 19 April 2013 By MicroPyramid

Django’s template system comes with a wide variety of built-in tags and filters designed to address the presentation logic needs of your application. You can extend the template engine by defining custom tags and filters using Python, and then make them available to your templates using the {% load %} tag.

Custom template tags and filters must be inside a Django app. If they relate to an existing app it makes sense to create them there; otherwise, you should create a new app to hold them.

Dynamic Models in Django (adding new fields to models from admin)

Posted On 04 April 2013 By MicroPyramid

Some times in the production level there may be a chance of adding new fields to our model.With the normal django models when we add new field to the model the database is not able to identify the new field.To make database identify the new field we have to drop the existing database from the database and sync our application again.During the time of production it is not possible to remove the existing data. The solution for this is Django-eav. With this we can add fields to our models on fly.

Need any Help in your Project?Let's Talk