Consume web service with DJANGO - python

I have a django application to show some data from my database (ORACLE), but now I need to show some data from a web service.
I need to build a form based in the request of the web service, and show the response of the web service.
I googling to expose my app as a web service and send and retrieve XML data.
But I am very confused and I don't know where to start or which django package to use(PyXML,DJANGO REST).
I am not sure if I need to build a web API or I can consume the web service without the web api.
Can someone give some advices to achieve this task.

You don't need to build a web API if all you want to do is consume someone else's API. Just retrieve the data - with something like requests - and use it in your Django app.

Related

How to communicate data from ReactJS and Python?

I'm building an app in which I need to communicate data from and to ReactJS and Python. It needs to go both ways - but I'm more concerned about the React part right now. At first I considered JSON, but couldn't find any resources/ libraries to update JSON files, and people said I should stay away from that. Other than literally creating a text file with data in it, what are my options? The application has to do with getting stock data from a python API, doing calculations on it, and sending the data to ReactJS to render on a webpage. I also need ReactJS to send account data back to Python where we do our MySQL. Any suggestions?
Since the ReactJS app is a front-end application, your only real choice to ensure security is exposing an API on the python app which the ReactJS app talks to (via Websockets for example since you're mentioning a bidirectional communication). Maybe take a look at something like Flask with the flask-socketio package.

How to create a Python API and use it with React Native?

I'm learning about basic back-end and server mechanics and how to connect it with the front end of an app. More specifically, I want to create a React Native app and connect it to a database using Python(simply because Python is easy to write and fast). From my research I've determined I'll need to make an API that communicates via HTTP with the server, then use the API with React Native. I'm still confused as to how the API works and how I can integrate it into my React Native front-end, or any front-end that's not Python-based for that matter.
I think you have to follow some online tutorial
And from my experiences, I think Flask is good choice for such case.
This is basic flask tutorial provided by tutorialspoint.com
You have to create a flask proxy, generate JSON endpoints then use fetch or axios to display this data in your react native app. You also have to be more specific next time.

To get accesstoken from microsoft outlook graph api for daemon app

I am trying to create a daemon python application which will get emails from outlook server using Microsoft outlook graph API. They have provided excellent tutorial and documentation on how to get it done for python app like django and flask. But I want to create daemon script which can get access code without using web interface(which was used in django).
Note: This app will only collect email from single email and will feed it to db.
Any help is appriciated.
It really depends on what kind of security you need. You can have your daemon/service authenticate with username/password directly, or you can have it authenticate with a certificate.
There are several different authentication scenarios, take a look at the docs page.
Either way, you need to register your daemon as an app in Azure and give it permissions to the Outlook API, just as if it were a web app.

How can I create an API for my web app and the mobile version of that web app in python?

I'm new to the API concept.I have a doubt about the API. I created a web app in Python-django framework.I need to create an API for this web application.I need to use this same app in mobile as mobile app.How can I possible this?
Can I create seperate API for the mobile app also? I searched this in google. but i can't find a correct answer.Please help me...
An API does not care if the client that sends the requests is a mobile app or browser (unless of course you send and use the information on purpose). For example if your API exposes the "www.myapp.com/registeruser/" URL and requires a POST with username and password, you can call this URL with those parameters from any client that is able to send that.
If what you want is use the same client-side code for both desktop and mobile (trying to understand what you need!), you can look at responsive websites. A package like django-bootstrap3 works very well with Django and is easy to use.
If your goal is to develop a native mobile application that will consume your API, then you can use Django REST framework to add API endpoint to your current Django application. One possibility is that you will have another file added in every app of your Django project, and it is serializers.py (at the same level as models.py).

Is there any graphite web ui which dosn't require graphite-webapp?

I want to deploy statistics visualization solution.
At first glance I'm playing with Graphite.
I would like to have something more interactive then standard django graphite-webapp.
I was looking at some dashboard alternatives http://dashboarddude.com/blog/2013/01/23/dashboards-for-graphite/
But it seams that all of them are a clients for Django graphite-webapp.
Is there any graphite web ui which dosn't require graphite-webapp?
There are no alternate dashboards for graphite that don't require the django webapp because its the django webapp that serves up the API for the /render url that every dashboard requires to retrieve data from graphite.
There's currently an experimental Go-based Graphite API server, graphite-ng, but it isn't feature complete.

Categories

Resources