Back

[SOLVED] Login with python sdk

  • 0
  • Self Hosted
user2m
18 Apr, 2023, 15:39

Hey all, could anyone point me to some documentation about loggin in with the python sdk?

I see documentation here about logging in with various other sdk's https://appwrite.io/docs/authentication#login

And when I go to the python sdk I don't seem to be able to find anything in the examples https://github.com/appwrite/sdk-for-python/tree/master/docs/examples

It seems that I'm looking for this createEmailSession function, but it doesn't seem to be in the account API for python

TypeScript
const promise = account.createEmailSession(
    'team@appwrite.io',
    'password'
);
TL;DR
Based on the support thread, the user was looking for documentation on logging in with the Python SDK for Appwrite. The user was initially confused about the architecture and mentioned coming from a Django world where most of the authentication system is managed on the server side. A suggestion was made to use a workaround with cookie jar and JWT. The user was then directed to the Appwrite documentation on account authentication and supported libraries for the client side. It was clarified that the `createEmailSession` function mentioned by the user is for client-side requests and is not available in the Python SDK. The Python SDK is meant for server-side environments only.
Binyamin
18 Apr, 2023, 15:41

The function you want to use createEmailSession is for client side request, they meant to be execute by the user,

The python SDK on the other hand meant to be used in a server side environment only.

Binyamin
18 Apr, 2023, 15:41

If you would go the documentation about account https://appwrite.io/docs/client/account

You can see the supported libraries for the client side

Binyamin
18 Apr, 2023, 15:42

On the server side you have more options but you won't be able to login as a user just like that

Binyamin
18 Apr, 2023, 15:43

What you can do is to have a workaround with cookie jar and JWT This is a bit of complex topic but you can achieve it

More details here 👇 https://discord.com/channels/564160730845151244/1092520228858105856/1092523507553935360

user2m
18 Apr, 2023, 15:47

Ok I see, I think i've misunderstood the architecture! The auth flow will be in a js function that is called when the user clicks submit on a form

user2m
18 Apr, 2023, 15:48

I come from a django world so I'm used to doing most of this on the server side

user2m
18 Apr, 2023, 15:48

Thank you for he quick responses!

Binyamin
18 Apr, 2023, 15:49

It's makes sense Also in other apps like Laravel you would manage most of the auth system on the backend side.

Appwrite main goal is to replace all your regular logic on the backend

Drake
18 Apr, 2023, 18:35

[SOLVED] Login with python sdk

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more