Tanzid
okay then, I want to add all domain.. what will be the codes..?
Mirco
okay then, I want to add all domain.. what will be the codes..?
Why all domains ? I mean don't you have a known consumer of those APIs?
Mirco
It is just for testing..
Ok so you have to set just this: CORS_ALLOW_ALL_ORIGINS=True And that's it
Mirco
And remove the duplicates into your settings Otherwise you have a mess
Mirco
And read the documentation or at least the package homepage because everything is explained
Sahil
I am trying to send mail from django from local host but getting ssl error what to do
∴
Hi everyone. I have tried hard to work with djoser. However, there is an error that I ve spent 2 days and havent moved forward.
∴
is anyone have a guess?
∴
the problem is in the return of the token
Muflone
The error refers to a Token object, not the Token model You cannot use objects on a single Token object (a row), but you must use the Token class
∴
is the token saved on db?
∴
The error refers to a Token object, not the Token model You cannot use objects on a single Token object (a row), but you must use the Token class
I can't control what django will try to acess. I am not trying to access the attribute 'objects'
Muflone
show your settings.py using pastebin
∴
https://pastebin.com/9xWsRuJe
Muflone
https://pastebin.com/9xWsRuJe
add rest_framework.authtoken to installed_apps
∴
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ django.db.utils.ProgrammingError: relation "authtoken_token" does not exist LINE 1: ...oken"."user_id", "authtoken_token"."created" FROM "authtoken...
∴
different error
∴
thank you
∴
now it works
∴
I run the migration and now it works
∴
but I have a question: there was 'rest_framework' in my installed_apps, why i had to add 'rest_framework.authtoken'? why rest_frameworks dont cover everything?
Muflone
https://www.django-rest-framework.org/api-guide/authentication/#tokenauthentication
Rose
User <Pablo /> ∴ has 1/3 warnings; be careful! Reason: Use a pasting service to share long piece of code
Mona
Hey Anyone have experience in django saml okta authentication
Mirco
Hey Anyone have experience in django saml okta authentication
Don't do meta questions, just ask what you wanna know
Mona
I want to write a poc sso login okta I’m trying to configure the setup at the backend but was unsuccessful, want to know the exact flow of it work logic goes with the implementation in django
Mona
It’s a small task for a person who has done it It’s on base level
Maxim
It’s a small task for a person who has done it It’s on base level
We're not here to do your job for you. This group is to help you on specific issues you have in YOUR code, so you have to show the code you wrote by yourself and explain where and why you are stuck... as simple as that. 🤷🏻‍♂️
John
I am seeking to implement a dependent dropdown feature for the fields ‘State’ and ‘District’ in my application. Could you provide guidance on how to achieve this, preferably through the use of APIs? I am open to any suggestions or best practices you might have.
Rathish
class="error">Invalid email or password. Please try again After I try to login it shows error,Admin site works fine,can do crud in back-end,
Husen
TypeError at /api/v1/course/ Field 'id' expected a number but got <django.contrib.auth.models.AnonymousUser object at 0x00000199FA052F00>. I entered the admin panel but could not find the user to go to this section. How can I fix this?
Jimmies San
Mirco
in the user model?
No, first you have to set the default auth for DRF
Husen
how to install? i am new to drf.
Mirco
how to install? i am new to drf.
So study DRF documentation and especially the authentication topic Otherwise we can stay here for ages
Tejas
how to install? i am new to drf.
https://www.django-rest-framework.org/tutorial/quickstart/
Mirco
Anybody know how to do this ...
https://www.bugbytes.io/posts/django-and-htmx-chained-dropdown/ example but with HTMX frontend side
Mirco
Anybody know how to do this ...
a bit old but always gold https://simpleisbetterthancomplex.com/tutorial/2018/01/29/how-to-implement-dependent-or-chained-dropdown-list-with-django.html
Pit
Hello, does anybody knows how to fix this problem? sqlite3.ProgrammingError: Cannot operate on a closed database. I just want to finish the command python manage.py dumpdata > .\fixtures\goods\cats.json I dii a little research, it gave me information that this error is connected with wrong encoding in db. Any ideas?
∴
what db are you using and what lib to cennect?
Erik
I have updated prod version of html but It isn't reflected on client side.
Erik
What is problem?
Anonymous
I have an email/password signup/login flow in my Django project. I want to add LinkedIn login flow to my project. I would like to use the current user table for LinkedIn login. What I want is when a user logs in using LinkedIn, I want to get the user information and save it to the current user DB ,login and redirect to the dashboard page. Please help me.
Maxim
Please help me.
please don't send useless messages
Jimmies San
Please help me.
Let me grab my crystal ball so I can read the past the present and the future
عبدالواسع
Asalam alykum I want to learn how to connect Django Rest Framework with flutter app Is there any courses for that ?
spignelon ‌‌‎
spignelon ‌‌‎
Just search on YouTube
Mr. Achiever
Hello Team, I'm trying to implement authentication system using Django 5. I'm able to achieve Login, but facing issues with logout. As per the documentation, it says we need to use POST method for logout. I did as per the documentation, but it seems the page never renders the template. On Django console, it shows below error: Method Not Allowed: /accounts/logout/ "GET /accounts/logout/ HTTP/1.1" 405 0 Please suggest.
Aamer
I am seeking to implement a dependent dropdown feature for the fields ‘State’ and ‘District’ in my application. Could you provide guidance on how to achieve this, preferably through the use of APIs? I am open to any suggestions or best practices you might have.
I usually use two approaches in such scenarios 1-send states json array (including districts associated with it) to fronted Render states dropdown from the keys of states json array keep zero option in district dropdown in default, and add onChange event listener to state dropdown which does following gets to list of associated districts with the selected state from state array and puts those as options in district dropdown 2- send states json array (without associated districts) Add same event listener to state dropdown as of 1st approach but event listener will call an api endpoint with selected state to get associated districts So in short, either pass the whole data at once to fronted via context OR have an api to get dependant records
Aamer
Asalam alykum I want to learn how to connect Django Rest Framework with flutter app Is there any courses for that ?
Yup, you can find on YouTube as spignelon replied Just want to add one thing, Django and flutter doesn’t have any relation at all So you can break it down to two sections for your clear understanding 1- How to create an API in Django (Backend) 2- How to interact with API in flutter (Frontend) Django’s API should be same for any frontend framework Flutters API Integration should be same for all backen/API frameworks
Erik
How can i reload my html in Django framework?
Morteza
How can i reload my html in Django framework?
What that means? Like refreshing the html without reloading the browser ?
Erik
Django framwork is working on production. When i update html, but it is not updated on client.
Morteza
Django framwork is working on production. When i update html, but it is not updated on client.
Restart the service, if that does not work restart the web server
Erik
Is it possible without restarting the server?
Erik
Restarting the service should loss many visitor.
Morteza
Is it possible without restarting the server?
No, your django server needs to be restarted for the changes to take effect.
Erik
How about changing py files such as views.py, urls.py?
Erik
?
Erik
When does Django reload htmls?
Erik
Only restarting server?
Erik
Just like that.
Is it possible?
Jimmies San
Django doesn't usually serve static files. How are you running Django in production? I assume you are using Nginx and usually it should serve the static files
.bit
Restart the server
No need to restart