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 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
Inbound Email Service for Creating Records in Salesforce
For any type of CRM, we will receive various emails from different external systems. To create or save the information received via emails in Salesforce, we have Email Services known as Inbound Email Service
How to Use List Methods in Salesforce
Apex provides collections such as List, Set, Map. These are similar to arrays, but these collections have advanced features and easier methods than an array. We will see about List, which is used widely in salesforce.
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.
Custom Decorators To Check User Roles And Permissions In Django
A decorator is a function that takes another function and returns a newer,prettier version of that function.
To know more about decorators in python see here https://micropyramid.com/blog/programming-with-python-decorators/
The most common use of a decorator is the login_required. This decorator is used in conjunction
with a view that restricts access to authenticated users only.
Best Practices of Using Django Celery in Django Social Auth
Best Practices of Using Django Celery in Django Social Auth.
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.
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.
Handling Custom Error Pages(404, 500) In Django
404 Page not found and 500 Internal server errors generally occur in every website. When these errors occurs, generally for Django application it will load page showing the application settings. So to avoid settings open, we'll keep DEBUG=False in production mode. But keeping DEBUG=False by default the pages will be served by webservers like nginx or apache which won't look good for an end user point of view.
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.