I want to generate a ticket using the api from an external system in django python. please help me with library required and code
You would have to roll your own solution. Documentation for the ticket API is located in the docs.
Please see: https://docs.osticket.com/en/latest/Developer%20Documentation/API%20Docs.html and https://docs.osticket.com/en/latest/Developer%20Documentation/API/Tickets.html