_NH
Was hoping to do without Javascript call. 👍👍 Thanks for the guidance.
Astrit
If i get it right.You can raise error through serializers
Michael the wolf 🐺
hi, suppose current url is http://localhost?next=something , then can I get the value of next i.e ., something in templates?
Michael the wolf 🐺
Ok, I will try that. Thanks
Klaus
How to connect to Cosmos graph DB in Django
Klaus
In setting.py file
Klaus
not with gremlin
Abhishek
is there anyone who can help me delete image from cloudinary
Abhishek
i need it urgently i will pay for that
Abhishek
yeah man
cj
OK.. So, that means that there is no way to handle it in python / django alone.
no, Python/Django is back-end only, if you want to play with front-end you can't escape from JavaScript claws
cj
He can use templates too
templates on DJANGO are rendered on server side, in case you didn't know
thenils
The redirect URI in the request, http://localhost:8000/oauth/complete/google-oauth2/, does not match the ones authorized for the OAuth client.
thenils
i changed url but still i am getting this error
thenils
help me if anyone have done social login before
Atkhamov
Can anybody suggest me tutorial for learning advanced tricks in Django ORM?
0x31c4ae1
How can I specify filtering by value in list_filter that I add using the method in ModelAdmin? class TotalReportAdmin(admin.ModelAdmin): change_list_template = 'admin/total-report.html' list_display = ('company_offered', 'get_ticket', 'get_hotel', 'get_visa', 'get_reg', 'get_country') date_hierarchy = 'company_offered__personal_manager__guest__airtickets__date' def get_country(self, obj): ticket = AirTicket.objects.filter(guest__personal_managers__company_offered=obj.company_offered) if ticket: country = ticket[0].country return country.country return None For example like here: how can I add filtering in admin panel by this get_country value? And in general - is it possible? I looked in the direction of SimpleListFilter, but my connections are a little confusing, having figured out this, I somehow brought up another column in the admin panel. Now I need to filter by it.
0x31c4ae1
can anyone help me?
Mirco
i changed url but still i am getting this error
It's not about changing url in Django
Anonymous
HEllo Guys Anyone Know Django Pwa systems ??
Manish
Anonymous
Yep
Anonymous
ıtry used django pwa but ı cant start system
Anonymous
PWA_SERVICE_WORKER_PATH = os.path.join(BASE_DIR, '/static', "serviceworker.js")
Anonymous
its tur but ı take this errror FileNotFoundError: [Errno 2] No such file or directory: '/static/serviceworker.js'
Vimal
I have completed my django forms project
Vimal
Whenever I refresh the i got multivalue error
Vimal
With name attribute in html
M
Anyone can help with working example of bootstrap model on django ..there are few examples on stack overflow but hard to understand 🙏
M
Actually when I can make upto model but I want to call another url based on params passed and get the data ..there it fails
Akash
Has anyone used Celery to schedule periodic tasks in Django app ? If yes, can you please tell is it possible to set it up for free on Heroku ? My understanding is that, we will need 3 different dyno, 1. webserver 2. Worker 3. Beat And using 3 dyno will cost money. Correct if wrong.
h
Hello guys, I'm getting error 500 and error 200 when i customized the PasswordResetSerializer, I'm not sure why this is happening. I'm contributing to an open source org which are using django-rest-auth for authentication purpose. Can someone please help me what's going on? Thanks error - django_1 | [pid: 55|app: 0|req: 1/1] 172.19.0.1 () {42 vars in 696 bytes} [Wed Jan 6 21:28:45 2021] OPTIONS /api/auth/password/reset/ => generated 0 bytes in 116 msecs (HTTP/1.1 200) 7 headers in 365 bytes (1 switches on core 0) django_1 | [pid: 57|app: 0|req: 1/2] 172.19.0.1 () {42 vars in 696 bytes} [Wed Jan 6 21:28:45 2021] POST /api/auth/password/reset/ => generated 211820 bytes in 1242 msecs (HTTP/1.1 500) 5 headers in 170 bytes (1 switches on core 0) Sorry for not providing in first place.
Mirco
And without an error or traceback is impossible to help u
h
just updated Thanks for your help.
Mirco
The log as it is does not give any help Use the DEBUG True and the runserver to have something more useful
Mirco
Those logs look like web server ones, we need the application server ones to understand and help u
Diego
Hey guys, how can i perform operations between multiples entries in my model using a jsonfield? Here's what i'm trying to do: { "players":{ "0":{ "name":"João" "pontos":"10" }, "1": { "name":Pedro "pontos":"5" } } { "players":{ "0":{"name": "João" "pontos":"5" } , } Result: { "players":{ "0":{ "name":"João", "pontos":"15" } , "1": { "name":"Pedro" , "pontos":"5" } }
Diego
Based on the same key value ("name") i wanna sum the "pontos" key for different entries in the same model
Mirco
Based on the same key value ("name") i wanna sum the "pontos" key for different entries in the same model
Take the json field in a variable and then treat it like a dict to have sum I don't remember right now if you can get the sum easily just using the ORM
Diego
Using for loops and if statements?
h
Those logs look like web server ones, we need the application server ones to understand and help u
Thanks for replying, Here in the source code DEBUG is already TRUE, also when I click on the "SEND" button to recieve the password reset email, it just displays "Soemthing went wrong", nothing else. This might be a total noob question but how can I provide you the application server logs? I tried to search on google first but didn't understand much. Thanks
cj
or even better, use a debugger
cj
Logging section of their settings file https://dpaste.org/oUVr
it only will send an email to admins if there are ERROR level logs
cj
yeah, you'd better use a debugger then and/or run it locally
h
Yes I'm running it locally, also the error that I sent previously are the ones I'm recieving. Yes thanks both of you, I'll use a debugger and try to solve this issue. Thanks for all your help, I am stuck at this for past 5 days.
cj
it only will send an email to admins if there are ERROR level logs
it also generates a django.log file for DEBUG level, check that just in case
Mirco
it also generates a django.log file for DEBUG level, check that just in case
It should not, the handler is defined but not used as I see
h
Sure, I'll update you guys regarding it, I'm not sure if i'll be able to understand the log file but I'll try full at my end , will try google it and then reach out to you. Thanks
cj
It should not, the handler is defined but not used as I see
oh yeah, you are right... it only uses "mail_admins"
Mirco
oh yeah, you are right... it only uses "mail_admins"
Yup it's the only "custom" handler in addition to the usual console
cj
good luck with the debugger
h
Just run it locally and Django will give you all u need It's easier if you cannot use a debugger
I'm running it locally, and the errors I provided above are the only errors I'm getting. No furthur infos I'm recieving from the console. No logs other than mentioned above.
Daniel
May I post a vídeo of signals in spanish
Doragonsureiyā
May I post a vídeo of signals in spanish
Read the rules before any activity: @PythonRules
Vimal
Whenever I refresh the webpage i got multivalue error
Vimal
In diango
Vimal
With name attribute could any one give the solution
Vimal
Yes manish
Vimal
index.html <form method="POST" action="login"> {% csrf_token %} {% if status == 401 %} <p style="color:red;">you don't have OTA access for P11 project,To get access refer this <a href="https://wiki.labcollab.net/confluence/display/AWV/New+Resource+On+Boarding+-+IN+Progress">wiki</a></p> {% endif %} <input type="text" name="username" placeholder="Username" required/> <input type="password" name="password" placeholder="Password" required/> <input type="submit" value="Login" /> </form> views.py def loginView(request): if request.method == 'POST': my_context={ } variable=[] if request.POST['username'] != "" and request.POST['password'] != "": username=request.POST['username'] password=request.POST['password'] request.session['user']=username request.session['pass']=password sess_user=request.session.get('user') sess_password=request.session.get('pass') check_login=kotaapi.dummy(sess_user,sess_password) variable.append(check_login.get('error')) if 'Exception' in str(variable) or check_login.get('code') == 401: my_context['status']=401 return render(request,'index.html',my_context) else: return render(request,'home.html',my_context) def submit(request): if request.method == 'POST': dsn=[] kbits_link=request.POST['kbits'] dsn=request.POST['dsn'] device_name=request.POST['dev'] otaGroup=request.POST['ota'] request.session['final_dsn']=dsn sess_user=request.session.get('user') sess_password=request.session.get('pass') kotaapi.get_data(sess_user,sess_password,dsn,kbits_link,device_name,otaGroup) return render(request,'dsn.html') urls.py urlpatterns = [ path('',views.registerView), path('login',views.loginView,name="login"), path('submit',views.submit,name="submit"), path('move',views.move,name="move"), path('hops',views.hops,name="hops"), ]
Vimal
The entire form functionality working fine
Vimal
But only issue is when i refresh the page i got username attribute error