Innovate anywhere, anytime withruncode.io Your cloud-based dev studio.

MicroPyramidBlog

Explore a blog dedicated to a wide spectrum of topics including Django, Python, Machine Learning, Salesforce, Angular, React, Flutter, Svelte, LINUX, and Amazon Web Services.

How to Customize the Admin Actions in List Pages of Django Admin?

Django by default provides automatic admin interface, that reads metadata from your models to provide a beautiful model interface where trusted users can manage content on your site. With this interface we can perform actions like delete, filter and other. In this blog post we learn to add new actions to the admin dashboard and how to disable built in actions of the admin dashboard.

Autocomplete with Django-Haystack and Elasticsearch with Single Letter Querying

Django's haystack provides autocomplete functionality. To do autocomplete effectively, the search backend(elasticsearch in this case) uses n-grams (essentially a small window passed over the string). Because this alters the way your data needs to be stored. We had two choices: NgramField and EdgeNgramField used as n-grams in search backend. The major drawback of the n-grams is that they take minimum of 3 letters in the search query.

How to Create Periodic Tasks with Django Celery?

Celery provides asynchronous job queues, which allows you to run Python functions in the background. Celery is on the Python Package Index (PyPi), and can be easily installed with pip or easy_install and its dependencies.

Implement Search with Django-haystack and Elasticsearch Part-1

Haystack works as a search plugin for Django. You can use different backends Elastic-search, Whose, Sorl, Xapian to search objects. All backends work with the same code. In this post, I am using elastic search as backend.

How to Index Binary Files in Django Haystack

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

Understanding Django Serializers with Examples

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

Introduction to Django's Class Based Views - Understanding How a Class Based View Works

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.

Basics of Django Templates

Django template engine comes as part of django framework and its very easy, extensible and handy to develop complex web applications with simplest efforts. Lets see basics of django template engine.

Basics:
A template is a text document, or a normal Python string, that is marked-up using the Django template language. Template system in Python can be used in the following way:

Dynamic Models in Django (Adding New Fields to Models from Admin)

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.

E-commerce (Paypal) Integration with Django

E-commerce is integration is becoming almost essential for every web application now a days. There are so many payment gateways to integrate with our application. Some of them are Amazon payments, Asiapay, BPAY, Brain Tree, PayPal ...etc. Out of these now in this we'll see how to integrate Paypal with our django Application.