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
#Replace 'symplcms' with the database'name | |
createdb --template=template0 --locale=en_US.UTF-8 --encoding=UTF8 -U postgres symplcms |
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 pathlib import Path | |
from typing import Tuple, Any | |
from aiogram import Bot, Dispatcher, executor, types | |
from aiogram.contrib.middlewares.i18n import I18nMiddleware | |
TOKEN = "TOKEN" | |
I18N_DOMAIN = "mybot" | |
BASE_DIR = Path(__file__).parent |
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, json | |
# Get refresh token from google drive api | |
# Generating a refresh token for DRIVE API calls using the OAuth playground | |
# https://www.youtube.com/watch?v=hfWe1gPCnzc | |
def getToken(): | |
oauth = 'https://www.googleapis.com/oauth2/v4/token' # Google API oauth url | |
headers = {'content-type': 'application/x-www-form-urlencoded'} | |
data = { | |
'grant_type': 'refresh_token', |