_NH
_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
No Name 😎🙍♂
Abhishek
yeah man
_NH
mat
mat
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
Mirco
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
0x31c4ae1
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 🙏
Mirco
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
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
Diego
Using for loops and if statements?
cj
Mirco
cj
or even better, use a debugger
h
Mirco
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.
Mirco
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
good luck with the debugger
Mirco
cj
h
Mirco
Mirco
Daniel
May I post a vídeo of signals in spanish
Vimal
Whenever I refresh the webpage i got multivalue error
Vimal
In diango
Vimal
With name attribute could any one give the solution
Manish
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