IMPORTANT: Backup your nginx site configs (usually under /etc/nginx/sites-available
)!
Remove old nginx incl. nginx-common:
apt-get autoremove --purge nginx nginx-common
# Remove old docker containers | |
docker rm $(docker ps --no-trunc -aq) | |
# Remove unreferenced images | |
docker images | grep "<none>" | awk '{print $3}' | xargs docker rmi | |
#OR | |
#alias dockercleancontainers="docker ps -a -notrunc| grep 'Exit' | awk '{print \$1}' | xargs -L 1 -r docker rm" |
class DictionaryUtility: | |
""" | |
Utility methods for dealing with dictionaries. | |
""" | |
@staticmethod | |
def to_object(item): | |
""" | |
Convert a dictionary to an object (recursive). | |
""" | |
def convert(item): |
def test_api(): | |
import json | |
import requests | |
from random import choice | |
from rest_framework.test import APIClient | |
from tws.sms.models import OTP | |
from apps.partners.models import GoodsCategory | |
api = APIClient() |
import unittest | |
from datetime import datetime, timedelta | |
def business_days(start, end): | |
""" | |
Calculating business days between two dates excluding weekends | |
:param start: First date | |
:param end: Second date |