Django allauth REST social login without DRF - django

I've been searching quite a while for a solution to integrate social logins provided by Django allauth with a mobile app, but all seem to point towards using DRF.
My Django project doesn't have DRF and I'd rather avoid to integrate it, as there are many things that would need to be changed in a rather complex project.
Is there any solution to integrate Allauth's social logins via REST in a non-DRF project, or will I have to re-write allauth's views to REST by hand?
Thanks

Use django rest-auth that's make the process easy there is no need to make any serializer
Here is the documentation and installation link for django rest-auth
https://django-rest-auth.readthedocs.io/en/latest/installation.html
I hope my answer help you

Related

Are forms necessary for Django authentication?

I'm new to Django and I'm working on a project which will be using APIs with Django REST framework.
And working on it, creating the authentication using DjangoDoc AUTH, I was wondering if it was necessary to use these forms, are there any other authentication or validation methods?
I took a look at these articles:
DjangoDoc
Quora
Django
Tutorial
But I can't see if they're really necessary or if there is another way.
Thanks for your responses!
You can use your own validations in your views, but it makes your code lengthy and you may omit some of the key validations required for authentication.
If you want, to have custom validations for the default forms you can use clean_methods to have your custom validations

Django rest_api and React

I am creating an am using Django and React. I have created custom user model api in Django using rest-framework, but i am confused about the whole login and signup system. Do we create login and signup modules in Django or React.
Can anyone please guide me through it, or suggest any tutorial.
You create the templates (login, signup, etc. pages) in React and connect them to DRF. There are multiple ways to perform authentication. Take a look to Authentication docs on DRF. https://django-rest-framework.org/api-guide/authentication

Using Django Rest Framework for only certain apps inside Django Application

I'm not sure if this is possible since an extensive search gave me nothing. Or I might be searching the wrong terms.
Now I have a few apps inside my Django application as follows:
--AppOne
--AppTwo
--ExtendedAdmin
manage.py
Now, AppOne and AppTwo use Django Rest Framework and its related Token Auth Mechanism. For the extendedAdmin, I'd like to use native Django Auth or even SessionAuth of DRF since I'm trying to add quite an extensive admin panel to the application. I've not been able to find a satisfactory way of customizing Django Rest Framework to work it's auth mechanisms only for certain applications. Is there a way to do this? If not, what should I be doing different?
So far, I know you cannot. Because django rest framework intercepts the url and then performs its own logic of token validation. But there are solutions that you can use to keep both Session and Token Authentication.
I am using this for all my projects -
I keep Session Authentication for all urls that will be accessed for normal browsing
and I use api urls with django rest framework to be prefixed with /api for my api urls
For example -
The Session Based login is at http://<host>/account/login
and TokenBased login is at http://<host>/api/account/login
The easiest way to make prefixed url for django rest framework is by using Routers - http://www.django-rest-framework.org/api-guide/routers/#defaultrouter
Example -
class UserViewSet(ModelViewSet): # just a sample view set
...
router = routers.SimpleRouter()
router.register(r'api/users', UserViewSet)

Invite Only app for Django Auth

I'm working on a Django web app and want to restrict signup to my site. For thatI want to use invite only app..I could find a couple of app built on the top of Django registration but I'm using Django Auth . Is there any app which I can use with Django app to get the same functionality.
General idea:
First, you can check out the code I have written which works fine for me.
Take a look at the example include in the application, you will learn
how to write your own pipeline. this pipeline can be redirected to any
view you would like.
from there you can save a invitation_key in your sessions and if that
key is valid, you can continue with create_user built in pipeline.
I have used this application for invitations that produces and validates invitation keys.
Implementation
It took me quite a day to figure it out.
This is a invite app built on allauth which restricts signup to invite only:
https://pypi.python.org/pypi/django-invitations/0.12

Is it possible to authenticate against a single source from two distinct Django deployments?

I'm hoping there's a straightforward answer to this question.
First, some history: I deployed a Django project and it uses all of the authentication mechanisms provided in Django. Namely, users are stored in auth_users and my login app validates against the records found in that table.
Now, I have a second, distinct Django project that needs to authenticate against the database from the original application. I'm not entirely sure how can I approach the problem, so I'm hoping someone in the stackoverflow community can help.
One thought was to add "myfirstproject.login" to the INSTALLED_APPS of the second project, but I'm uncertain if that's a viable option (CSRF issues?). Again, any insight is appreciated.
Try the sites module?
http://docs.djangoproject.com/en/1.3/ref/contrib/sites/
Create an auth backend?
http://docs.djangoproject.com/en/1.3/topics/auth/#specifying-authentication-backends
Inherit from contrib.auth to create your own auth module?
CSRF would only be an issue if you were trying to authenticate by telling the client browser to ask the first site for auth; which is unlikely to be the best path to take.