pathlib path of current file code example
Example 1: pathlib path get directory of current file
import pathlib
pathlib.Path(__file__).parent.absolute()
Example 2: pathlib path of current file
from pathlib import Path
BASE_DIR = Path(__file__).resolve().parent.parent
TEMPLATES_DIR = BASE_DIR.joinpath('templates')