If you are hosting a Django app with Kubernetes, there are a few things that you need to take care of.
Here is a sample Dockerfile for a containerized app:
FROM python:3.9-buster
RUN apt-get update \
    --fix-missing \| ''' | |
| Proof of Concept: | |
| Django devs built an ORM that seems way more straightforward than many existing tools. This class lets you leverage the django-orm without any project settings or other aspects of a django setup. | |
| There are probably weak points and functionality missing, but it seems like a relatively intuitive proof of concept | |
| ''' | |
| import os | |
| import django | |
| from django.conf import settings | 
| ## See https://github.com/FactoryBoy/factory_boy/issues/836 | |
| import inspect | |
| from typing import List, get_args, get_origin | |
| import factory | |
| import factory.fuzzy | |
| from dataclasses import dataclass, Field, MISSING, is_dataclass | |
| from enum import Enum | |
| from datetime import date, datetime | |
| from decimal import Decimal | 
| drought,professor,barber,kneel,orbit,germ,darts,dance,cape,beanstalk,sushi,baby-sitter,ping pong,mime,Heinz 57,half,swamp,sheep dog,macaroni,hurdle,Internet,lie,logo,rind,fireman pole,raft,wig,salmon,pigpen,letter opener,cabin,fireside,cell phone charger,dent,jungle,dripping,saddle,fabric,sleep,mirror,ski goggles,ringleader,scream,point,neighborhood,yardstick,applause,cliff,loveseat,sponge,chess,grandpa,peasant,cruise,CD,drawback,chestnut,yolk,pilot,season,bedbug,world,important,bleach,biscuit,bobsled,pharmacist,shampoo,swarm,moth,sneeze,deep,sunburn,pizza sauce,houseboat,password,dryer sheets,migrate,snag,koala,catalog,husband,darkness,shower curtain,rib,extension cord,honk,landscape,water buffalo,wooly mammoth,cheerleader,cloak,birthday,nightmare,fizz,clog,myth,wind,banister,post office,knight,rim,think,bride,comfy,hydrogen,baguette,vitamin,lace,tiptoe,sweater vest,pail,glitter,plow,retail,leak,pocket,crust,mascot,macho,hail,bargain,time machine,drain,vegetarian,bookend,ivy,taxi,foil,mast,gold,chime,commerc | 
| # commit hook to prepend the JIRA ticket from the branch name to the commit | |
| # Installation for one repo: | |
| # - copy this file into your git repo's .git/hooks folder | |
| # - make sure its executable: | |
| # chmod a+x repo-path/.git/hooks/prepare-commit-msg | |
| # Installation for all new repos: (you'll still have to do the above for already cloned repos) | |
| # - tell git where your global hooks live: | |
| # git config --global init.templatedir '~/.git-templates' | |
| # - mkdir -p ~/.git-templates/hooks | |
| # - copy this file to ~/.git-templates/hooks | 
| import boto3 | |
| from PIL import Image | |
| from io import BytesIO | |
| import os | |
| class S3ImagesInvalidExtension(Exception): | |
| pass | |
| class S3ImagesUploadFailed(Exception): | |
| pass | 
| bash -c 'while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' localhost:9000)" != "200" ]]; do sleep 5; done' | |
| # also check https://gist.github.com/rgl/c2ba64b7e2a5a04d1eb65983995dce76 | 
| #!/usr/bin/env python | |
| from __future__ import print_function | |
| import json | |
| import logging | |
| from urllib2 import Request, urlopen, URLError, HTTPError | |
| from base64 import b64decode |