I need to run Python script without external dependencies so I can not use SDK for python. I also do not want call external tools like sentry-cli from script for that purpouse
I need simply send two events to specific Project, using DSN.
I can not google it or find in API reference(there only methods about listing\retrivieng issues/events but not sending them)
So my question is how to send event to sentry project using DSN?
The same way any of the SDKs does: post the data to Sentry API for the given DSN. There are multiple sources you can use to build that:
read up on Sentry SDK development docs: https://develop.sentry.dev/sdk/envelopes/
have a look into Sentry python SDK source code to see what's going on and reimplement the pieces you need (keep the code license in mind): https://github.com/getsentry/sentry-python
Try the Sentry JavaSCript SDK and post an even through browser devtools console, then you can see the exact payload on the network tab.
Related
I'm currently trying to develop an application to use ms-graph API using python.
I'm trying to use SSO authentication but I cant find any resources or documentation related.
I found this documentation https://learn.microsoft.com/en-us/office/dev/add-ins/develop/sso-in-office-add-ins
but it is only for javascript.
I wrote a script using Flask and another script using O365 python package.
It doesnt seem like its a Single sign on application that I try to achieve...
I'm looking for any documentation that could help.
You are referring to the Office web add-ins where you could also use SSO. But it seems you are developing a standalone application where Graph API is used. In that case you may find the Configure SAML-based single sign-on for your application using the Microsoft Graph API tutorial helpful.
I have a Django web application hosted on Ubuntu 18.04 and on the same machine I have installed the QGroundControl.
In my Django Web Application there are two buttons (Take Off & Return to Land).
Is this possible that when I press the Take Off button from my Web Application, it should invoke the Take Off method of QGroundControl?
How can I connect the Django (Python) Web Application & QGroundControl?
There will be some API or Web Service etc? Any idea?
I am not using QGroundControl. However, from a quick look at the doc, I think the most straightforward way is to compile your own version of QGroundControl to add a remote control feature. It's open source and the code is available here.
If QGroundControl does not need to be running all the time, you could modify it to accept command-line arguments to request take-off or landing. These commands could then be launched by Django using the subprocess module.
If QGroundControl needs to be running all the time, you could change it to run a socket server, to which you could connect with a Python client, or in your case some Django code. See here for a (very) minimal example.
If all this looks complex to you, you can always ask QGroundControl developers for a feature request to run a control server with the software.
I want to create pods, manage replica sets, and deployments using a rest API either built with PHP or Python. This needs to be controlled from a web app where the user clicks on a button and a new pod with a specific volume is created. I'm not sure how to achieve this.
I came across KC8 API and Python KC8 client API but I'm unable to achieve what is required. TIA
Kubernetes is controlled through an HTTP REST API, which is fully specified here. You could write a web app that directly issues the appropriate HTTP requests to the Kubernetes API server.
However, it's much more recommended to use one of the Kubernetes client libraries that exist for different programming languages. These libraries wrap all the HTTP requests in function calls and also take care of things like authentication.
You can find example code using the different client libraries in the GitHub repositories of most libraries (see here).
In essence I want to run existing python scripts through a web browser, display the text and plots(if any) and also keeping the ability to run them through the command line.
I am wondering is there any toolkit that can help me with the development.Also it would be nice if the toolkit does or allows JavaScript based interactive plots.
Thanks!
-Abhi
WSGI is designed for just this purpose - it provides an interface for a web server to initiate python scripts.
You probably don't want to work with WSGI in the raw. Flask is a straightforward, simple framework you might use for this.
The details of how to actually build a WSGI web server are well beyond the scope of a stackoverflow answer - you can find plenty of tutorial docs on Flask's website.
My goal is to use to make it easy for non-programmers to execute a Python script with fairly complex options, on a single local machine that I have access to. I'd like to use the browser (specifically Safari on OS X) as a poor man's GUI. A short script would process the form data and then send it on to the main program(s).
I have some basic examples of python scripts run using the built-in Apache server, by clicking submit on a form whose html is th:
e.g. here. What I want to do now is do it without the server, just getting the form to invoke the script in the same directory. Do I have to learn javascript or ...? I'd be grateful for any leads you have. Thanks.
It doesn't make sense -- what a browser does when it submits a form by definition is to make a request to a web server.
If all that's going on is that you don't want to be running Apache, you could hook something simple up using the CGIHTTPServer class that's provided as part of the Python Standard library.
If you don't want a server process at all, and you're using a suitably modern browser, you may want to look at using HTML5 local storage, but that's not a Python solution.
Well, there always has to be some kind of "server" involved to communicate over HTTP. You could have a python script listening on port 80 on your machine, that in turn runs the scripts specified with the form's action attribute.
You won't get away without some sort of server, I'm afraid.
PS: There are already a couple of good minimalistic python HTTP servers that would do the trick. Just google for it.
Regards, aefxx
Pyjamas Desktop will allow you to deploy a browser-based desktop application.