I've been tasked with adding CAS authentication to an existing Django app which uses the Django Rest Framework.
Using django-cas library I'm able to authenticate via CAS to the admin features of the Django framework, but I'm not sure how to go about authenticating the Django rest framework app via CAS; it's still authenticating via some custom authentication logic that the original developers added. If anyone has any insight or experience with this it would be much appreciated.
My (empty) django project deploys just fine, but when I switch to login: required and set the Authentication Type to Google Apps domain I get a 500.
Sadly there doesn't seem to be any debugging info on GAE. Nor can I reproduce the error locally. I checked the domain name I entered twice.
Any lucky guesses?
Ok, found the problem.
Looking into the AppEngine logs it discovered this:
Authentication for the Google Apps domain example.com can only be performed when requests are served from a subdomain of that domain or it has been approved through the Google Apps Control Panel. See https://developers.google.com/appengine/articles/auth
The solution is discribed here: https://developers.google.com/appengine/articles/auth#AppspotDomainAuth
What is the definition of a Django application? Any application that uses Django features, such as orm and url-view mapping?
I ask because I have a component which has 2 sub-components: a web service server and a standalone application. The web service server uses Django views to map url to request handlers. The web service server and the application use Django models and a database managed by Django. The web service server obviously needs to be a Django application. The standalone application must be a Django application as well?
Thanks in advance.
No, importing your models is enough, as long as you have Django installed and correctly configured.
I have created one web2py application, now i have to deploy this application to facebook so the user can login to facebook and can access this application from there, is there any way to achieve this?
Please help me out to resolve this problem.
Regards,
Piks
You have to start understanding how Facebook apps works, after that you will be able to develop web apps using any framework and "deploy" that to be used as a facebook app.
Start here: https://developers.facebook.com/
Which of these would you pick for a B2B app (targeting small/med-small businesses) built on GAE with python:
Google Accounts
Custom Users with Django
Custom Users with Web2Py
I'm very tempted to go the Google Accounts route as it's very well integrated into GAE and takes care of everything from user creation to session authentication, and even takes care of forgotten passwords. However, I'm sure there are significant drawbacks to this, including usability, but if you are starting from scratch, which approach would you pick and why?
I started with Google account, added all OpenID and quickly found that the only accounts people use for my site are google and facebook accounts. So now I only have login with google and login with facebook. But I'm going to add my own accounts and I'm doing it with webapp2 instead of django and instead of web2py. I tried web2py but webapp2 and its auth model seem much better and not like with web2py a lot of unnecessary code that is not for app engine.
Try this and its auth model (there is example code from http://code.google.com/p/webapp-improved/issues/detail?id=20) and I hope it will work for you.
Google Accounts forces users to have Google Apps or Gmail accounts. Some customers might not like this.
Rolling your own is an (unnecessary) burden: you have to have sign up process (with captcha and/or 3rd party email confirmation), keep all user records, handle the security, etc..
I'd suggest you go with OpenID: http://code.google.com/appengine/docs/python/users/overview.html#Authentication_Options
Why both Create Django user from Google users. you will be able to adapt your system user with other system next
I've understood that question was only on authentication after I've written this so most of things here are offtopic, but I just wanted to demotivate on using full-stack solutions like django or web2py in appengine.
I can tell you something about django because I've used it for over a year and I do like it for certain types of websites. It was first framework which I've tried to use on appengine and I've dropped it after two weeks.
These are things in django which doesn't work or make no sense in appengine:
django models and orm: designed for sql; appengine sdk has its own models.
django admin site: is designed for sql databases, doesn't work on appengine
auto-forms from models: designed for django models
django management commands: none of commands which come with django is useful when working with appengine SDK.
django development server: appengine sdk has its own development server, django's one does not work.
django "plugable apps" architecture: at least in my practice it was useless on appengine.
static files collector: great tool to collect static files from various reusable applications into one folder, only if you have many reusable applications.
There exists django-nonrel project which says it can run django with admin site on appengine. It can, with half of things working and a lot of bugs. You spend more time trying to fix what does not work than building things.
What might be useful from django framework:
django forms: can be exchanged for a better library WTForms
django url routing: can use Werkzeug instead
django request/response objects and HTTP exceptions: can use Werkzeug instead
django pretty-printing exceptions: Werkzeug does it better, it adds a web debugger.
django i18n and localization: can be changed with babel
django templates: jinja2 is similar and a lot faster, which is important because appengine is an expensive platform. ctypes module is required to debug errors in jinja templates, however ctypes is forbidden on appengine, but on development server it does work, for debugging you don't need more.
Actually Jinja2, Werkzeug, WTForms and babel are so cool, that there exists projects for each of them which integrates them with django.
I know two frameworks which use these libraries:
kay-framework: made for appengine, a bit outdated, but a great example how you can use Jinja2, babel and Werkzeug on appengine.
flask from Armin Ronacher, the man behind Werkzeug and Jinja2.
I've not used web2py, however since it is also a full-stack framework like django is, I think it will be as bad as django is. Full-stack solutions simply do not fit in this different environment. Simple libraries fit in any environment.