Facebook, Django, and Google App Engine - python

I'm experimenting with app-engine-patch (Django for GAE) on Google App Engine. And I would like to write a Facebook application. Is it possible to use PyFacebook and its middleware? Or is there some other solution?

I run a system on for social networks and facebook on GAE with back-end in Python, front end in Javascript and Flash. I use mostly client side js libraries to pass data back to the server side datastore. This library for facebook to be exact: http://code.google.com/p/facebookjsapi/
There is a reason for this. Most of what we are doing will be running on its own site, in iframes in different social networks and in widgets etc. But for the most part this has worked very well. It is good because we can swap out our backend at any time or even run it on multiple platforms as it is also using a python rest GAE library but any backend would do with this setup.

Adding the Facebook directory from the PyFacebook install directory to the app-engine-patch application allows you to add 'facebook.djangofb.FacebookMiddleware', to the MIDDLEWARE_CLASSES in settings.py. Then your view can use 'import facebook.djangofb as facebook' and '#facebook.require_login().'
I haven't gone end to end, but when I tried to display the view preceded by '#facebook.require_login()', I was redirected to the Facebook login.

According to this post, you need a slightly modified PyFacebook that you can download from a URL given in said post (I haven't tried it myself, though).
Edit: that link is wrong -- better link and more discussion on this thread.

Related

How can I let users authenticate into my django-react website with github?

I can't find ANYTHING on google or stackoverfliow about this. I'm using django and react and I want one of those "Log in with Github" buttons on my login page. I doubt anyone has time to write the whole process but maybe a link to a good source? Thanks!
Here is a simple example that demonstrates various social Authentication [starts with Github integration]. I will also attach official python Social-Auth documentation.
Integrating various Social Auth - including Github auth
Python Django Social-Auth Documentation

Python as back-end and Polymer as the front-end

I want to create a desktop application written in python and using polymer as the front-end. To access the user interface, we use web browser such as chrome, mozilla, and safari. I did a lot of research in how to do this. The only reference I have is home Assistant, but I'm still don't quite understand about the architecture and the approach. Anyone have another solution or approach in how to do this?
python ships with a basic http server, however according to the docs it's not made for production use. But it's probably good enough for your use case (single user). On top of this you can implement a basic REST-Api and serve your frontend (.js/.html) as static content.
Or use a framework like django https://www.djangoproject.com/

how to show a django application inside a site in wordpress

I have a site made in wordpress and i´d like to show my django application inside this site. I don´t know how to do that. How do call my django application and show it inside the site.
Your other option - far more work and technical than using an iframe - is to show the content in the WordPress site by using django-rest-framework (on the Django app) then pulling in the content via API requests.
It would be a lot of work, but well worth learning and provide you the most flexibility.
The steps would be
Install django-rest-framework for your Django app
Setup up and configure an API
Either use PHP on the server or JavaScript on the frontend to pull in the content from the API
Only using iframes, because they bore are diffrerent frameworks using different languages etc... so you will make to make one iframe inside your wordpress page and inside that page to load one url from your django application
https://www.w3schools.com/tags/tag_iframe.asp
try to detail your issue. Do you need a link in your wordpress´site ? have you tried loading it using iframe ?
It´s really important to show inside a wordpress´site ?

How to implement normal site registration/login together with social authentication(mainly facebook) in Django?

I'm a newbie in Django and I'm trying to port my vanilla php application to Python/Django. In my project, I want to let users authenticate using regular registration/login form or through social authentications like facebook, google and twitter.
I searched on google and stackoverflow for similar questions and came to know about django-social-auth, django-allauth, django-socialregistration etc. I tried django-allauth but failed to implement it properly resulting in lots of template syntax errors.
My questions are :
1) Which one should I choose for my requirements - regular + social authentication? Any live website where I can test it?
2) Which one is most used in live production sites?
django-social-auth is fantastic, has a good support community and is very quick to set up. You can run it easily alongside regular auth and will also work nicely alongside django-registration and django-profiles (I've used all 3 together before). It also has a demo.
It's also the most watched on Github when you compare it to the others on django packages which is a good indication of it's popularity.
Integrating separate packages can be a real pain. If you use django-allauth this work has already been done for you....
I stumbled upon this review of four django social auth apps.
The top two are:
django-allauth
django-social-auth
At the time it was written, allauth had the lead but I believe (from looking at the github projects) that nowadays django-social-auth is more popular

Where can I find a (current) example of code to bulk upload data to Google AppEngine? (For localhost, too.)

I've tried to do it like they describe in the AppEngine docs but I can't get it to accept my upload. (I haven't tried to download.) I want to get it working in the development environment before I tried on the live site.
It's kind of confusing, because I don't know if I should be trying appcfg.py or bulkloader.py. (I mostly tried appcfg.py.) I think it's an authentication problem, as it keeps asking me for the email/password. (Even after I removed 'login: admin' from app.yaml.)
I did --dry_run and it seemed to work, so I think my stuff is well formed.
Before asking for specific debugging help, I thought I would ask if anyone knows of working sample code that I can download. I run OS X 10.6, if anyone cares. I'm not new to Python, and have a lot of web.py experience, so it's probably not unfamiliarity with the language that's tripping me up.
The docs have a section on uploading and downloading data, with examples. You should be using appcfg.py unless you need one of the features of bulkloader.py that are not yet integrated, such as --dump/--restore functionality.
It sounds like the authentication problems you're having are related to Google Apps: If you have an App Engine app that allows any Google account to authenticate, and you have a Google Apps account as administrator, you won't be able to authenticate against your app as an administrator with it, even if you have created a Google account for that email address. You need to create a gmail account, and add that account as an administrator, so you can use that address when you need to authenticate against your app.

Categories

Resources