Got it. I can't show you the whole code, as it's a...
# general
c
Got it. I can't show you the whole code, as it's a private project for a client, but I can ask you about my main issues: First of all, in the documentation it says to
Copy code
Add the code below to your server's init file.
, but I'm not sure which **init **file to use: the project's __init__.py? The app's __init__.py? Another file I haven't considered? My next question, is the app_info fields, I'm not sure enough about some fields' meaning:
Copy code
app_name='', # A generic name, the name of my Django app or the name of my Django project?
api_domain='http://localhost:8000', # I understood this one.
website_domain='https://localhost:3000', # I understood this one too.
api_base_path='/api', # Is this the path of the Django application?
website_base_path='/' # I don't get this one at all... Mind you, I haven't set up the front-end yet, but I've read the documentation about it.
r
Hey! Let’s talk here
c
Ok
r
How are you defining project vs app?
c
Copy code
django-admin startproject myproject # This is the command used to create the project.
Copy code
python manage.py startapp api # This one is for creating the app inside the project.
r
Hmm. Im@still not quite sure. But you should call the init function wherever your server initialisation happens. Essentially, you want to make sure that the init function is called by the time you use any of the supertokens functions from the library
c
Ok
r
app_name should be equal to the name of your app that will be shown in email verification / password reset emails (depending on which recipe you are using)
c
Ok, so it's not related to the name of the Django app, thanks.
r
api_base_path is the path prefix for all APIs exposed by supertokens. By default it is /api, so all APIs exposed by the supertokens django middleware will be on /api/*. For example, /api/signin
Sorry. By default it is /auth
In your code you have set it to be /api, so all APIs will be in /api/*
c
Ok, got it
r
website_base_path is where the login UI would be shown in your frontend app. By default it’s /auth. So the login page would be on /auth
(Applicable for if you are using our react SDK)
c
Ok
So it's optional if I'm using another framework
r
Yea. Both api_base_path and website_base_path are optional
c
And if I want to propose a login form for Svelte, for example (as you have only a React one)? Where should I make the proposal?
r
What do you mean by proposing it?
c
Open a pull-request / issue
r
You can make an issue about it in the supertokens-core repo
But a pr - are you asking about making an example app with svelte? Or actually providing Ui support for svelte?
c
Providing support for Svelte
r
Right. So that would be in a brand new repo dedicated to svelte. You can just make it under your own GitHub and then we can fork it if it works and meets all the criteria
c
I'll try to provide a fully working Django example & a svelte implementation as soon as I'm done with the exams. I'm really grateful for your help 😀
4 Views