syedj
Have anyone used flask framework
syedj
I have a query
syedj
Using flask rest api can we define endpoint without extending Resource module?
syedj
Like i want to define only one method should that be in class extending Resource
syedj
Can't there be function based
entropy
Anonymous
entropy
thx!
welcome. fieldname_before and fieldname_after will be used for the date range you are filtering
Алишер
Hi, guys!
Question about Django ORM
I have models that referenced by ForeignKey and OneToOneFields.
E.g.
[Model1, Model2] ref. to Model3.
Model3 ref. to Model4.
After save Model4 will other referenced models be saved?
Or I must save all models manually?
Mohit
I want to block deletion of an object based on a boolean field of the object in model. I want to override the delete method in serializer. I'm using django rest framework. What is the method to override? I'm using generic views.. Retrieveupdatedestroy api view
Mohit
Алишер
Mohit
Mohit
Thanks
Anonymous
Wah gwaan..
Is there anyone using django-machina?
raven
what it is?
🏳️🌈Robby [ Private Message = Spam]
what it is?
Nobody actually cares until they ask an actual question versus a meta question
raven
👍
Shubham
Hello caught with an error
Shubham
TypeError at /
init() takes 1 positional argument but 2 were given
Shubham
from django.contrib import admin
from django.urls import path, include
urlpatterns = [
path('admin/', admin.site.urls),
path('',include('account.urls'))
]
Shubham
and an app url
Shubham
from django.urls import path
from account import views
urlpatterns = [
path('', views.CustomRegisterView)
]
Shubham
resolved
Shubham
thanks @robbyoconnor
Shubham
path('', views.CustomRegisterView.as_view())
🏳️🌈Robby [ Private Message = Spam]
🏳️🌈Robby [ Private Message = Spam]
Can you really not understand that?
🏳️🌈Robby [ Private Message = Spam]
I'm far from pc but later on I will show up what I get
Well that guide explains exactly how to get started and they provide example applications, so you're not trying hard enough. Sometimes you have to actually read and can't just copy/paste your whole app.
🏳️🌈Robby [ Private Message = Spam]
inchidi
Shubham
Hello I have created the custom model authentication in django rest , so far I dont have front end , so my question is , Im I done with the API, since on browser it gives an error TemplateDoesNotExist at /
rest_framework/api.html that of course due to I dont have template, in postmen its giving {
"detail": "Method \"GET\" not allowed."
} , Am I going right?
Shubham
https://github.com/shubham1507/school
Alibek
Hello there. I want to make microservices w/ Django. In particular I want to make auth microservice w/ JWT auth. Well the question is: I have some other microservices, and there is a special ms called test. There I make some test stuff and if it passess, I apply it to other ms (for example, I setup Redis on test ms and it works, so I setup Redis on other ms like Task Manager). And I want to use 2 JWT tokens. One for test microservice only, and another one for other microservices. How can I achieve this? Any resource would be appreciated.
cokicoki
Manish
I want to add popup file upload on click button if file is not exist
Manish
Hey buddies
Manish
Getting problems in configuring django rest auth with jwt
🏳️🌈Robby [ Private Message = Spam]
Manish
pasting code..😁😁
Manish
https://dpaste.de/etOM urlpatterns
Manish
https://dpaste.de/2wSN settings.py
🏳️🌈Robby [ Private Message = Spam]
and the error
Manish
login endpoint output {
"token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoxLCJ1c2VybmFtZSI6ImtyaXNobmEiLCJleHAiOjE1NTU5OTYxNTksImVtYWlsIjoiIn0.nllvIiTzKf2rAb8h3VQPAAdELjRFmd9JumTO8hmFTjM",
"user": {
"pk": 1,
"username": "krishna",
"email": "",
"first_name": "",
"last_name": ""
}
}
Manish
{
"detail": "Given token not valid for any token type",
"code": "token_not_valid",
"messages": [
{
"token_class": "AccessToken",
"token_type": "access",
"message": "Token is invalid or expired"
}
]
}
Manish
🏳️🌈Robby [ Private Message = Spam]
The token or invalid.
🏳️🌈Robby [ Private Message = Spam]
Manish
https://dpaste.de/2wSN#L9 see this
Manish
i think there should be something like rest_auth.jwt
🏳️🌈Robby [ Private Message = Spam]
https://github.com/davesque/django-rest-framework-simplejwt
Manish
i am following this https://django-rest-auth.readthedocs.io/en/latest/installation.html#jwt-support-optional
Manish
help someone please
Manish
Hey @robbyoconnor i fixed it.
🏳️🌈Robby [ Private Message = Spam]
Manish
in authorization header by default we have to use JWT then token But i was using Bearer and Token
🏳️🌈Robby [ Private Message = Spam]
Manish
but there is a problem with jwt
Manish
which is logout
🏳️🌈Robby [ Private Message = Spam]
which is logout
JWT is stateless. Since the tokens are shortlived, it doesn't matter
Manish
🏳️🌈Robby [ Private Message = Spam]
blacklisting token are not available by default.
If you actually care, then use that — otherwise — the way I handled this was i passed two tokens, the actual token PLUS a refresh token, can be anything, but this is stored in case of the token expiring and I only query for if I need to
Manish
Manish
i will say last thing django is much harder than flask.😂
🏳️🌈Robby [ Private Message = Spam]
Manish
THanks BTW @robbyoconnor
inchidi
Manish
Manish
Manish
non expiring token are more dangerous than jwt