Hello 1C programmers, Ilya Nizamov with you.
Flagship course "AI for 1C": https://nizamov.school/courses/ai/cha...
Author's Telegram channel: https://t.me/+9iyfWeGqvMg2NTcy
Website and blog: https://nizamov.school/
Recently, there have been several questions about using 1C and Python. This can be done in various ways, but I find microservice development the most convenient. In this lesson, we'll use FastAPI; it's a fast web framework and perfectly suited for our needs.
There was also a request to protect configuration and extensions. I'm against such protections, as anyone who wants to can hack them, and it will cause a lot of problems for legitimate customers. This problem can be solved by moving some of the logic to a microservice and hosting it in the cloud. Alternatively, you can compile the Python code after protecting it first.
This lesson will be short. Give it a like if you found this helpful, subscribe to the channel and Telegram, and let's get started.
Article on the website
https://nizamov.school/python-1c-mikr...
Timecodes:
00:00:00 — Why a microservice on FastAPI and code security
00:01:20 — Installing FastAPI, Uvicorn, and imports
00:02:00 — Pydantic model and POST handling function
00:04:00 — Launching a microservice and documentation
00:05:21 — Request from 1C to the service
00:08:01 — Packaging in Docker: Dockerfile
00:10:44 — .dockerignore and docker-compose.yml
00:13:22 — Building and running the container, checking from 1C