Skip to content

Instantly share code, notes, and snippets.

View Pal-Sandeep's full-sized avatar
⛰️
Contributing

Sandeep Pal Pal-Sandeep

⛰️
Contributing
View GitHub Profile
@Pal-Sandeep
Pal-Sandeep / install.sh
Created January 18, 2023 16:35 — forked from kodekracker/install.sh
A shell script to install all required applications and dependencies required to setup working environment after fresh install ubuntu .
#!/usr/bin/env bash
# System wide Constants
# Ubuntu Code Name Ex:- trusty for Ubuntu 14.04
CODE_NAME=$(lsb_release -cs)
## Install basic libraries required for ubuntu environment
sudo apt-get install libcurl4-openssl-dev libssl-dev -y
sudo apt-get install zsh -y
sudo apt-get install python-software-properties -y
@rg3915
rg3915 / django_orm_optimization_cheat_sheet.py
Last active August 26, 2023 15:51 — forked from levidyrek/django_orm_optimization_cheat_sheet.py
Django ORM optimization cheat sheet
"""
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.
"""
# ---------------------------------------------------------------------------
DEFAULT_FILE_STORAGE = 'backend.custom_azure.AzureMediaStorage'
STATICFILES_STORAGE = 'backend.custom_azure.AzureStaticStorage'
STATIC_LOCATION = "static"
MEDIA_LOCATION = "media"
AZURE_ACCOUNT_NAME = "djangoaccountstorage"
AZURE_CUSTOM_DOMAIN = f'{AZURE_ACCOUNT_NAME}.blob.core.windows.net'
STATIC_URL = f'https://{AZURE_CUSTOM_DOMAIN}/{STATIC_LOCATION}/'
MEDIA_URL = f'https://{AZURE_CUSTOM_DOMAIN}/{MEDIA_LOCATION}/'