Skip to content

Instantly share code, notes, and snippets.

@firedotguy
Created January 30, 2026 20:53
Show Gist options
  • Select an option

  • Save firedotguy/7425cb692b95dd85e28b0ff85d530e57 to your computer and use it in GitHub Desktop.

Select an option

Save firedotguy/7425cb692b95dd85e28b0ff85d530e57 to your computer and use it in GitHub Desktop.

Гайд на полу-админку в ИТД

1769806318
  1. Устаналиваем расширение по типу requestly в браузер. В Firefox называется "Requestly V2"
  2. Добавлем правило:
изображение

UPD: на скрине опечатка

  • Тип: redirect
  • Откуда: https://itdsocial.com/api/profile
  • Куда: http://localhost:8000
  1. Скачиваем python если еще нету. Должно открываться что то по типу командной строки после отправки python в терминал
  2. Создаем файл с названием main.py желательно в отдельной папке
from fastapi import FastAPI, Request
from fastapi.middleware.cors import CORSMiddleware

app = FastAPI()

# без корсов не пускает
app.add_middleware(
    CORSMiddleware,
    allow_origins=['https://itdsocial.com'],
    allow_credentials=True,
    allow_methods=["*"],
    allow_headers=["*"],
)

@app.get("/")
def root():
    return {'authenticated': True, 'user': {'id': '9096a85b-c319-483e-8940-6921be427ad0', 'username': 'ЮЗЕРНЕЙМ', 'displayName': 'ИМЯ', 'avatar': '💩', 'verified': False, 'roles': ['user', 'admin']}, 'banned': False}

@app.options("/")
def root_options():
    return

можете вписать любой юзернейм или имя

  1. Скачиваем фреймворк fastapi - pip install fastapi[standard]
  2. Запускаем в терминале fastapi run в папке где вы создали файл В консоли должно появится что то вроде:
  FastAPI   Starting production server 🚀

             Searching for package file structure from directories with __init__.py files
             Importing from D:\projects\test_server

    module   🐍 main.py

      code   Importing the FastAPI app object from the module with the following code:

             from main import app

       app   Using import string: main:app

    server   Server started at http://0.0.0.0:8000
    server   Documentation at http://0.0.0.0:8000/docs

             Logs:

      INFO   Started server process [11860]
      INFO   Waiting for application startup.
      INFO   Application startup complete.
  1. Открываем https://itdsocial.com/admin в браузере Должна открыться админ панель, но без данных
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment