hi! I am very baffled about the django documentation. I want to build the equivalent of this in Dja...
p
hi! I am very baffled about the django documentation. I want to build the equivalent of this in Django DRF: https://passwordless.demo.supertokens.com/auth/ This seems like some half-finished thing that does nothing except report unauthorized at : https://github.com/supertokens/supertokens-python/tree/master/examples/with-django/with-thirdpartyemailpassword And this appears to be a generic description of how to setup django auth and has nothing particularly to do with Super Tokens: https://supertokens.com/blog/django-bootstrap-login-template I don't get it. Does Super Tokens work with Django Session or DRF JWT middleware or not?
r
hey @possum 🐘🤓🐘
we do work with it. See our guides page and follow from there: https://supertokens.com/docs/guides. You can even try out the
npx create-supertokens-app@latest
command on your terminal
p
Ok thx i will try working from the FE reference app to your backend django sample app.
@rp_st hi! duh so sorry I did not try that demo app creator first. Ok so I am using the Django REST reference app but when I substitute the demo keys with my API keys from the Dashboard I get an Invalid API Key error. I'm probably doing something stupid but I cannot figure out what it is. I am replacing
Copy code
supertokens_config = SupertokensConfig(
    connection_uri="https://try.supertokens.com")
and
Copy code
dashboard.init(api_key="supertokens_is_awesome")
with what is shown at my
https://supertokens.com/dashboard-saas
page for dev environment.
And I am very baffled by another thing I'd be very grateful if I could some clarity on: I am trying to port my DRF app over to Super Tokens, which uses Session middleware to authenticate Django Users. However, I don't understand how that integrates with Super Tokens, which is also using Django Session middleware to to persist a user session. I was expecting
supertokens_python.recipe.session.framework.django.syncio
to create and return Django Users, but it seems like I still need to create and login the Django User myself based on the Super Token session. Is that right?
r
Yea, we won't create a django user for you out of the box. But i think there is some issue in our github in which we show you how you could do that.
p
@rp_st could you find that for me 🥺? I couldn't see it here: https://github.com/supertokens/supertokens-python/issues?q=Django
k
hi, does anybody know why I may do not see anything on http://localhost:11000/auth/dashboard ?
r
have you enabled the dashboard recipe?
k
No, I didn't, thank you so much, it's helped !
161 Views