Posts

Showing posts from March, 2022

Use of django.contrib.humanize outside the django template

The humanize can be used in any python files in a Django project by adding the reference Eg: from django.contrib.humanize.template tags.humanize import intcomma no_of_votes = intcomma(total_votes) Ref :https://docs.djangoproject.com/en/4.0/ref/contrib/humanize/

Nginx - Compression

gzip on; gzip_static on; gzip_comp_level 6; gzip_buffers 16 8k; gzip_min_length 1000; gzip_types  application/json application/javascript application/xml application/xml+rss font/eot font/otf font/ttf image/svg+xml text/css text/javascript text/plain text/xml; Reference resource : https://www.digitalocean.com/community/tutorials/how-to-improve-website-performance-using-gzip-and-nginx-on-ubuntu-20-04

Generate dynamic Avatars

External resources to generate dynamic letter based avatars UI Avatars https://ui-avatars.com/ avatar.oxro.io Initials Avatar Generator API (oxro.io) GitHub resource: https://github.com/eddiejibson/avatars

PIP -- Help Guide

Get the version and details of the installed package  pip show django the sample output  Name: Django Version: 3.1.5 Summary: A high-level Python Web framework that encourages rapid development and clean, pragmatic design. Home-page: https://www.djangoproject.com/ Author: Django Software Foundation Author-email: foundation@djangoproject.com License: BSD-3-Clause Location: c:\python\lib\site-packages Requires: asgiref, pytz, sqlparse Required-by: django-appconf, django-celery-email, django-haystack

Development Test Emails

 https://github.com/ChangemakerStudios/Papercut-SMTP