This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from sqlalchemy.engine.url import URL | |
from sqlalchemy import create_engine | |
from sqlalchemy.orm import sessionmaker, Session | |
CORE = int(os.cpu_count()) | |
DB_URL = URL.create( | |
drivername="mysql+pymysql", | |
username='root', | |
password="1234", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import annotations | |
import os | |
from functools import cached_property | |
from typing import List | |
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'config.settings') | |
import django |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
from http.server import BaseHTTPRequestHandler, HTTPServer | |
from urllib import parse | |
client_id = "" | |
client_secret = "" | |
google_email = "" | |
def get_token_url(): | |
url = "https://accounts.google.com/o/oauth2/v2/auth" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
from sqlalchemy.orm import scoped_session | |
from src.utils import start_mapper | |
from sqlalchemy import engine, schema | |
from sqlalchemy.orm.session import Session, sessionmaker | |
from src.domain.posts.post_entity import PostEntity |