I hereby claim:
- I am YujinYuz on github.
- I am yujinyuz (https://keybase.io/yujinyuz) on keybase.
- I have a public key whose fingerprint is 4AE2 4951 FD87 7868 0FBB B197 2172 3017 BFBD 7D2D
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
******************************************************************** Set up Django, Nginx and Gunicorn in a Virtualenv controled by Supervisor********************************************************************
Steps with explanations to set up a server using:
# clean up any backups not used in the past 7 days out of the ~/.backup directory | |
@daily find ~/.backup -type f -name '*;*' -not \( -atime 0 -or -atime 1 -or -atime 2 -or -atime 3 -or -atime 4 -or -atime 5 -or -atime 6 \) -delete |
# core/middleware.py | |
import sys | |
from django.views.debug import technical_500_response | |
class UserBasedExceptionMiddleware: | |
def process_exception(self, request, exception): | |
if request.user.is_superuser: | |
return technical_500_response(request, *sys.exc_info()) |
from django.apps import apps | |
from django.contrib.contenttypes.models import ContentType | |
from django.core.management.base import BaseCommand | |
from django.db import connection | |
from django.db.models import Case, F, Value, When | |
from django_tenants.utils import schema_context | |
from tenant.models import Tenant |
upstream warehouse_inventory { | |
zone inventory_service 64k; | |
server 10.0.0.1:80; | |
server 10.0.0.2:80; | |
server 10.0.0.3:80; | |
} | |
upstream warehouse_pricing { | |
zone pricing_service 64k; | |
server 10.0.0.7:80; |