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.
Hosting Django Application with Nginx and UWSGI
Django is a python based web- application development framework. Setting up a sample app and running it as easy as pie. Nginx is a webserver and like every other webserver it has it Pro's and Con's. Nginx was an answer to concurrency issue(handling thousands of concurrent connections) faced in apache and raised to fame.
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.
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.
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.
Understanding Django Permissions And Groups
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.
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.
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)
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
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.