how to setup user authentication in django - django

I've been using Django to make this Web Service and I'm wondering how to make the user authentication work. I heard that there's a built-in method to do it in Django, but I can't find it. Does anyone have some experience in how to do this?

The tutorial on djangoproject.com is fairly good for explaining this.
See: https://docs.djangoproject.com/en/1.5/topics/auth/

Related

How to implement google and facebook oauth2 in django rest framework?

I am a nodejs developer but currently migrating to django(being a python lover). I am trying to implement OAuth2 in Django Rest Framework but I don't know how to start.
In nodejs, there is passportjs library which is well maintained, and it's got stratigies for every possible authentication type. What about django rest framework ? User name/password auth seems straightforward but oauth2 is not well covered.
In DRF docs here, It mentions two libraries for oauth. The first is django-oauth-toolkit which is well maintained but after going through docs, I didn't seem to understand much, it doesn't even talk about googl/facebook oauth. I am not sure what it is used for, anyway. The second one is django-rest-framework-social-oauth2 which seems to be straightforward but it's not been touched for over a year, it's probably not maintained any more.
So, How do you guys do oauth2 in your DRF projects ?
I hope you have solved this already. You can check my repo: It offers a simple way of authenticating against major ouath2 vendors. Here it is https://github.com/wagnerdelima/drf-social-oauth2.
You can also check my other repo https://github.com/wagnerdelima/facebook_setup. It integrates https://github.com/wagnerdelima/drf-social-oauth2 as an example to make it easy for newcomers.

Python's bottle and cork for authentication in web applications

I am a newbie in python.I have created a web page using bottle and python .But the thing is i want to use authentication and session feature in it many suggested to use cork but cant understand it can anyone explain me how to use or is there any other way to do it
My code is like :
#route('/ldlereport',method='GET')
def new_item():
return template('ui.tpl')
i need to verify the user who can view this site
Thanks all ,
There are two examples on the cork-website: with decorators and without decorators.
While bottle is a good micro framework to learn web programming in python, authentication is not a newbe topic as you see by the examples. Before implementing such an advanced feature I would strongly recommend to go through some more simple examples like the TODO-List App to learn routing, templating and database queries first.
If you still want to stick to authentication:
Due to bottle's flexibility you are free to choose your webserver. The Cherrypy microframework has a webserver with builtin SSL-Support as you see here: bottle on cherrypy server + ssl. This might be easier for the beginning, but besides configuring Cherrypy's SSL-adapter, you still have to create your SSL-certificates.

How can I create a oauth (REST) API ( like twitter or foursquare ) using django?

I would like to create an oauth (REST) API the same way Twitter or Foursquare does.
I found this website http://djangopackages.com/ which is really great and has several packages but I would like some opinions on which is the best package, etc...
I would like, for example, let people to allow permission to 3rd party apps to access their data (Using API Keys, etc...)
Thanks a lot!
Django is a wonderful web framework. It helpes you in many ways making rich web applications. It helps you starting in form handling and ending in templating.
However in your case if your intension is just to make an awesome API such as of Twitter or Foursquare, you have to ask yourself if you need all this help Django provides. For example, are you ever going to use any templates in the API or process a for submittions. The answer is probably not...
So if you need a very flexible framework to developer an API, I would highly recommend to take a look into Pyramid. It is very similar to Django, however does not have all this extra cludder which is not necessary for an API.
However if your application needs both a rich user interface and an API or you just want to use Django, like Ulusses suggested, then I think TastyPie is for you. It is a great library where you can have a running API in no time. I use it all the time and it is very flexible. ReadTheDocs uses tastypie.
Another API lib is piston. I haven't used it so can't judge if its better or worse then tastypie. Bitbucket however uses it.
You can check out https://github.com/toastdriven/django-tastypie or https://bitbucket.org/jespern/django-piston/wiki/Home.
You can achieve what you want with both, check out on the documentation the one that suits you best.
I use Django REST framework. It is awesome.
Piston is dead. Tastypie is awesone, but works with Django only. There are pros and cons with Django as well as Pyramid. If you need great ORM, sqlalchemy is only one, and there is no good example of using it with Django, so in this case you have Flask, Bottle or Pyramid. Django ORM is really not at that par.
If you choose Pyramid, you will have to write a lot of things, and the framework is just skinned boneless cat. You need to assemble and configure every block, seems frustrating to many including me.

Twitter in Django

I have to create web application similar to twitter with a few tweaks using django. I am clueless if I have to use a CMS for this or any other existing django-application. Working from ground up is quite tedious to be honest. Can anyone recommend me which CMS( or anything else) I should attempt trying?
There is a project called trillr1. According to its page:
"Trillr is a Twitter-like microblogging service enhanced with user directory and group discussion features. " that's maybe what you want.
https://contributions.coremedia.com/trillr1
I guess, the closest you can come with an out-of-the-box software to imitate Twitter is Status.net, the software, that powers identi.ca. However, this is a PHP application.
I'm not aware of something similar in the Django world.

Can anybody comment on django-wapi?

Aside for a few user guides found at http://fi.am/en/tag/django/2/ I have not managed to find much about WAPI.
I was wondering if anyone has had an experience using WAPI and django to create a web api?
I'm a little intimidated by the amount of magic these frameworks seem to do.
Are there any other good alternatives to creating a web api in python?
Here is a decent guide to the django WAPI for building a restful API: http://fi.am/entry/building-a-website-api-with-django-part-2a-api-aut/