I am trying out Flask-OpenID in App Engine. Flask-OpenID uses a 'store' to save authentication information. If I mention '/some/path' to save data, it doesn't work in App Engine, as it is read-only.
For Flask-OpenID to work, I have to write my own 'store' which uses App Engine's datastore or cloud storage. I have not much idea on how to write this store. Is there any document available, so that I can follow. It will be helpful if I get any input on writing the 'store' using Flask and App Engine.
Disclaimer: I am not the author of the framework, but I am using it everyday. You can start with gae-init which is a working example using Flask-OAuth for authentication. Login and other goodies are provided out of the box, and you can get an overview about it and educate yourself at docs which are still under construction.
Related
I have been deployed my Django project to the Google App Engine. I wanna add cronjobs to my Django project and there is a cool feature for it in Google App Engine.
If I understand it well, I must create GET functions for my cronjobs in my views.py. But how do I make them callable only by the App Engine and no one else? Or, maybe there is a better solution for cronjobs in Django?
You can validate your request by checking header X-Appengine-Cron at your endpoint. This header is only supplied when your endpoint is triggered by GAE cron jobs.
Reference link:
https://cloud.google.com/appengine/docs/standard/python3/scheduling-jobs-with-cron-yaml#validating_cron_requests
I'm trying to follow the examples for getting OAuth up and running with a Python app as described by Google's API.
They use a flask example only.
In the case of this, for example:
#app.route('/test')
def test_api_request():
if 'credentials' not in flask.session:
return flask.redirect('authorize')
# Load credentials from the session.
credentials = google.oauth2.credentials.Credentials(
**flask.session['credentials'])
...
How would I know what to replace the **flask.session['credentials'] with in my Django application?
I am still attempting to do the same thing, but without Flask.
What is the Django equivalent for flask.session?
The code is taken from here: https://developers.google.com/api-client-library/python/auth/web-app#example
Hi there are few resources available in the reference itself you can find some help using these links
Using Django
Also, a working sample application is provided by the API guide
Sample App
For further information, you should read the OAuth guide.
Is there a tool/client to view inside and make queries for google appengine datastore?
Starting with release 1.1.9 of the App Engine SDK, however, there's a new way to interact with the datastore, in the form of the remote_api module. This module allows remote access to the App Engine datastore, using the same APIs you know and love from writing App Engine Apps.
http://code.google.com/appengine/articles/remote_api.html
And some wrapper around it:
Today, I will share with you a simple script – remote.py – which can do all the necessary staging in order for us to talk with our App Engine back-end at Google. remote.py provides a single function attach(host), which will configure the API to communicate with the specified host. This will allow us to easily write scripts that interact with the live serving application, or if we need to, a newly-deployed version.
http://blog.onideas.ws/remote_api.gae
You can login at AppSpot and go to the "Datastore Viewer". You can run custom GQL queries and view/edit entities in the datastore.
I'm currently building a Python webapp on the Google App Engine and I want to expose various parts of my application via a JSON API. This API may be used in the form of a mobile client, or (for the purposes of testing) a headless Python script.
I need to be able to authenticate users before they perform operations on the API. I notice that the Users API does not support simple authentication [in the form of authenticate(username, password)] so merely sending the username/password to a URL and then later using some given token would not work.
Ultimately, I would like the application to use Facebook Connect in addition to its own logins.
Could somebody please suggest how is the best way to authenticate users in this situation, using a remote JSON API and the Google App Engine?
Cheers
You might want to check out the recently released oauth support. Failing that, you can implement your own authentication, for example by using simple or digest authentication.
Just for the record, I ended up going with the wonderful Tipfy framework in the end.
How can I store some data on Google App Engine? I'm using Django.
Assuming you don't want to just write web form pages to do this, you might want to take a look at http://code.google.com/appengine/docs/python/tools/uploadingdata.html which explains a few different ways to import/export data from the appengine datastore.
You can use google app engine helper. Django cannot understand google app engine so you can use this helper to make the Django understand app engine and you are good to go..
http://code.google.com/p/google-app-engine-django/