Authenticate a wordpress website user to a django website - django

I have a pre-existing wordpress website and I am creating a django website which would provide other services to the users of the wp website. Now I want to display the products in the django website but I want to know how could I automatically authenticate the user while he has accessed the wordpress website so that the dynamic content of the website could be shown to him.
Earlier I was trying to generate query in the url for the django website by I'm not a php guy and further I came across the idea of generating cookies from the wp website and retrieving it on the django website but I didn't know how to do this.

Related

Django oAuth2 without saving the user into the database

I'm currently coding a website with Django and I successfully implemented an external oAuth2. (I'm not using any libraries) the problem is that the user is saved in the database. I would like to avoid it for hosting costs reasons.
In my current project, the oAuth2 is purely for verification purposes.
Is there a way in Django to log in a user in without saving him to the database? I would like the website to keep him logged in if the page is refreshed but logged out if the page is closed.
Thanks!

How do i access wordpress data/dashboard?

So, I have created a custom dashboard using Django. I want to access all the fields(activeplugins, active themes, wordpress version, etc) present in my wordpress dashboard and display it in my dashboard.
Wordpress doesn't have default REST endpoint to access admin related data such as plugins, themes. You will have to implement custom endpoint for that. Please refer wordpress devDoc for that. https://developer.wordpress.org/rest-api/extending-the-rest-api/adding-custom-endpoints/

How to request data from an open source website such as Reddit or Github and display on the Local Django Website?

I am quite a newbie to Django and I am trying to understand how API calls and requests work in Django. I have a simple Django website that has User login and authentication system. I want a user to save the top ten reddit posts and display them on their respective login system. I have seen the request method in Python and some web-crawling methods. I am unable to figure out a way to request data from Reddit .
Here is the code I have written so far :
https://github.com/darthvedder17/Django-Website-Reddit

How to allow only the Django authenticated users to view Wordpress contents?

I have a Django application (SaaS) and a Wordpress blog (documentation/user guide for the SaaS application).
Now I want to make sure that only logged-in user in the SaaS application (Django) should have access or can view the (documentation/user guide) in Wordpress blog.
In the Wordpress, I've added this block in functions.php that restricts access to content only to Wordpress members.
function members_only() {
global $pagenow;
// Check to see if user in not logged in and not on the login page
if( !is_user_logged_in() && $pagenow != 'wp-login.php' )
auth_redirect();
}
add_action( 'wp', 'members_only' );
This gives one level of content protection if someone hits direct URL to Wordpress blog.
I do not want to touch the Wordpress code base anymore.
Can I add some authentication mechanism in Django side so that when user clicks on User Guide button, they are redirected to the Wordpress site and can view the content.
And if someone has direct hit to Wordpress site they are redirected to the WP login page.

Django Social Auth - Google login

I want to use Django Social Auth for getting logged in a website using a Google account. But I am unable to find a good tutorial and the tutorials available are not very clear. What are the changes required in Settings.py and what should be the value of keys like GOOGLE_CONSUMER_KEY and GOOGLE_CONSUMER_SECRET?