Skip to content

Instantly share code, notes, and snippets.

View santoshpy's full-sized avatar
🐍
Focusing

Santosh Purbey santoshpy

🐍
Focusing
View GitHub Profile

Pyenv Important Commands

1. To list available python version

pyenv install -list

2. To install specific version of python

@santoshpy
santoshpy / async_download_images.py
Created June 5, 2021 16:13
Python3 Download Image Asynchronously From List of URLs.
"""
To Download Image Asynchronously From List of URLs
"""
import asyncio
from pathlib import Path
import aiofiles
from aiohttp import ClientSession
@santoshpy
santoshpy / .pylintrc
Created September 2, 2020 06:51
pylintrc config file
[MASTER]
# A comma-separated list of package or module names from where C extensions may
# be loaded. Extensions are loading into the active Python interpreter and may
# run arbitrary code.
extension-pkg-whitelist=
# Add files or directories to the blacklist. They should be base names, not
# paths.
ignore=CVS
@santoshpy
santoshpy / celery.conf
Last active June 26, 2020 15:26
Celery worker and scheduler in the background as a daemon with Supervisor.
; install supervisor > sudo apt-get install supervisor
; adding configuration files to the “/etc/supervisor/conf.d/” directory on the remote server
; ==========================
; celery worker supervisor
; ==========================
; the name of your supervisord program
[program:{{appname}}_celery]
"""
Django ORM Optimization Tips
Caveats:
* Only use optimizations that obfuscate the code if you need to.
* Not all of these tips are hard and fast rules.
* Use your judgement to determine what improvements are appropriate for your code.
"""
# ---------------------------------------------------------------------------
@santoshpy
santoshpy / project_structure.md
Last active September 15, 2023 06:11
# Django Project Directory Structure

Django Project Structure

  • <virtualenv_name>
  • bin
  • include
  • lib
  • src
  • documents
  • requirements >>>>- - base.txt
@santoshpy
santoshpy / .gitignore
Last active February 6, 2024 23:52
gitignore file for django project
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# C extensions
*.so
# Distribution / packaging
@jefftriplett
jefftriplett / .dockerignore
Last active November 20, 2022 21:44
How I use Docker and Compose
.*
!.coveragerc
!.env
!.pylintrc