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.

Django Custom Template Tags And Filters

Django Template Tags are simple Python functions that accept a value, an optional argument, and return a value to be displayed on the page.
First, In your application folder, create a "templatetags" directory at the same level as the models and views.

You want this directory to be recognized as a Python package, so make sure you create an empty "__init__.py" file. Next, create the Python file that will hold your tags and name it something like app_tags.py.

Python Memcached Implementation for Django Project

Memcache is a memory caching system that helps web applications and mobile app backends to improve performance and scalability. We should consider using Memcache when your pages are loading too slowly or your app is having scalability issues. In This Blog Post, Let's see how to use Memcached for server-side application caching.

Integrate Django-Oscar-Accounts with Django-Oscar

This package uses double-entry bookkeeping where every transaction is recorded twice (once for the source and once for the destination). This ensures the books always balance and there is full audit trail of all transactional activity.

Setting Up Coveralls for Django Project

Coveraslls will check the code coverage for your test cases. To use coveralls.io your code must be hosted on GitHub or BitBucket.

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.

Best Practices of Using Django Celery in Django Social Auth

Best Practices of Using Django Celery in Django Social Auth.

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.

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.

Django Inclusion Tags

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.

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.