- Only one time need to initialization
git init
- Add single file or folder or all changes made
URL | Result | Reason | |
---|---|---|---|
http://example.com/* | OK | Only the path differs | |
https://example.com/* | Not OK | Not the same protocol | |
http://example.com:1234/* | Not OK | Not the same port |
import json | |
import logging | |
from time import sleep | |
from confluent_kafka import Consumer | |
from django.core.management import BaseCommand | |
logger = logging.getLogger(__name__) | |
# pip install confluent_kafka |
import base64 | |
from cryptography.hazmat.backends import default_backend | |
from cryptography.hazmat.primitives import hashes, serialization | |
from cryptography.hazmat.primitives.asymmetric import rsa, padding | |
KEY_SIZE = 2048 | |
PASSWORD = b'1234546' # bytes of string | |
PRIVET_KEY_ENCODE = b'LS0tLS1CRUdJTiBFTkNSWVBURUQgUFJJVkFURSBLRVktLS0tLQpNSUlGSFRCWEJna3Foa2lHOXcw\nQkJRMHdTakFwQmdrcWhraUc5dzBCQlF3d0hBUUl4VEhpRWl6RUZ1VUNBZ2dBCk1Bd0dDQ3FHU0li\nM0RRSUpCUUF3SFFZSllJWklBV1VEQkFFcUJCREhWREs0NHp1enRDOVZGNlRoZ0pIMkJJSUUKd05E\nckR0MWpRaVBPWEFMaHhLVFJIRW9nVE9OS25tN1R0MVJ2b2hvc2FqWEdKYTByUUJxRXJFZlFBUjA4\naHJRdwp1anJFM3g1aUw3eGNRQmV2eWczMnYyWHBBYXBoczZKRjJoNklibUxabE0rU29mMmpMbVJv\ndzNOZ0x4ODg4c3ZRCm94V25WZXpGMCtZY0VIWHZKd3NvbkRmOFEvRHA3b08vdi9ndm1MMkpqcVl5\nZVh0LzlEanMyRVpRQzVQbTJIekcKR0dLSVBaRk9lWDdCWkcybFp0Q2RPWDZEcmJXdk9STjkwbmxF\nc1ZsOVVhOWlPVVk1OTNreFYwS3M0QUhUekJOQwpjcFhUaHp6R1dOckp4R08wMjV2TnZUcTNqQUZ0\ndXdyMXowV2NpNmZsdktHQUxIVkxya2JadEhYU2kzK1lLSWlkCkJqUXcyRkh2OURkY25hZ1NCSFYz\nZnhPNm14S1Jad0JXcGVpRDlzSEVjQnZvZnJJOU |
version: "3" | |
services: | |
server: | |
container_name: django_app | |
build: . # from Dockerfile or image name | |
command: gunicorn core.wsgi:application --bind 0.0.0.0:8001 | |
# ports: | |
# - 8000:8000 | |
network_mode: host |
from django.conf import settings | |
from django.core.mail import EmailMessage | |
from django.template.loader import get_template | |
class EmailService: | |
def __init__(self): | |
self.from_email = settings.EMAIL_HOST | |
def send_email(self, subject: str, template: str, data=None): |
def is_base64(base_64): | |
try: | |
if len(base_64) == 0: | |
return False | |
if isinstance(base_64, str): | |
# If there's any unicode here, an exception will be thrown and the function will return false | |
sb_bytes = bytes(base_64, 'ascii') | |
elif isinstance(sb, bytes): | |
sb_bytes = base_64 |
#pip install mailjet_rest | |
from mailjet_rest import Client | |
from os import getenv | |
from dotenv import load_dotenv, find_dotenv | |
load_dotenv(find_dotenv()) | |
api_key = getenv("MAIL_API_KEY") | |
api_secret = getenv("MAIL_API_SECRET") |
node_modules | |
build | |
npm-debug.log | |
.env | |
.DS_Store |
docker run --mount type=bind,source="$(pwd)"/build,target=/usr/share/nginx/html -p 8080:80 nginx |