Брат
Брат
You should override post function in your class
Jean-Yves
i don't wanna use a POST method
Брат
3 - Class based views - Django REST framework
https://www.django-rest-framework.org/tutorial/3-class-based-views/
Jean-Yves
it's kind of specific, i wanna do it with get
but , I can't come yet
Брат
Брат
I know only one way of doing this don't take it serious and ask from others:
1. Go to urls and set up new path which will include 'somename/<field1>/<field2>/, YourViewName.as_view()
2. Get the object in your view with those fields and create it
Jean-Yves
fateme
hi guys. have you ever got in trouble with .heic photo format and django imagefield ?
It seems django imagrfield does not support the .heic photo formating!
have you any solotion?
EL
Benson
Good day guys.
I'm trying to implement a location feature on a django real estate project. in the project, a user will see a property and alongside it a map that shows the property on it represented by a marker.
Thing is, I'm a beginner and don't know how to do it yet.
I'd like to ask how one goes about it from the bottom up, from the back end ( I figured out the interface. )
I know this is a HUGE ask, but I'm politely asking anyway. Any assistance will be highly appreciated.
Thanks.
BigBad
Hello, what are the best versions of Django to start learning now?
And are any versions backwards compatible?
Max
Anonymous
Alik
Max
Brian
Well, Here's a code share(https://codeshare.io/ayvgRn) of the issue. I'll appreciate anyone who'll engage me on this.
Maxim
Maxim
Brian
Brian
So is anyone aware of what could be the issue with my urls set up? The documentation led me to this set up but still I can't get past the error 404.. Code here: https://codeshare.io/ayvgRn
....
https://stackoverflow.com/questions/71184672/when-i-trying-to-object-save-i-got-an-error-missing-1-required-keyword-only-a , can anyone answer this question ? ?
Gowda
How to authenticate microsoft using DJANGO
Gowda
Django and python
Anonymous
Брат
Getting default Validation error when trying to create a User.
Брат
http://linkode.org/#8OqTqHM6bGd7Psx3urBMz4
Брат
{
"first_name": "string",
"last_name": "string",
"username": "anqov",
"email": "user@example.com",
"password": "string2",
"password2": "string"
}
When posting above dictionary, Im getting default validation error:
{
"username": [
"A user with that username already exists."
]
}
Брат
{
"first_name": "string",
"last_name": "string",
"username": "anqov",
"email": "user@example.com",
"password": "string2",
"password2": "string"
}
When posting above dictionary, Im getting default validation error:
{
"username": [
"A user with that username already exists."
]
}
However, according to my validate function, there should be several errors, and if username is already exist, there should be another message not like this, which was set by default. It should be: 'This username is already taken'
Javokhir
from django.contrib.admin.models import LogEntry
LogEntry.objects.all().delete()
Javokhir
hi everyone I need help I want to delete recent actions in django admin panel where should I use this code in models.py or admin.py ....
tech-tycoon
I think ,you should put this code in views.py
tech-tycoon
And then connect it to a url and proceed
Ademola
Hi. I am trying to paginate my list in Django table without hitting database.
Ademola
Ademola
But I want it to affect the listing table directly from front. Not the database.
Pythonista
Can someone help me?
How do I consume an external API with django to bring the data to the Front End?
Pythonista
I need a reverse proxy for this, but I don't know how to do it.
Pythonista
Anonymous
> But how would it be possible to sort a SET
From the theoretic perspective, a set not necessarily should be unsorted, like in python. It just can be not sorted. Sets only insure that you don't have repeated elements.
> get index of single object without having to load all the queryset values.
then just get that element. Simple as that.
Getting the element wasn't a problem, what i wanted was in what order it sits within the sorted list of (or set?) Queryset,
Let's say there's a post created at 1am, 4am & 6am. If i sort the post queryset by 'created_at' field, its order would be
0 - a post created at 1am,
1 - a post created at 4am,
2 - a post created at 6am...
If i wanted to get the index of the post made at 6am, I would expect a value 2... I just don't want to load all the posts, just the index of the single element or object within queryset
Don't know if my explanation is clear Sorry for my bad English.
Ademola
Rudraksh
def search(request):
ids=[]
if request.method == 'POST':
text=request.POST.get('searchQuery')
r1=Cheque.objects.filter(accountName__contains=text)
r2=Cheque.objects.filter(chequeNumber__contains=text)
r3=Cheque.objects.filter(chequeAmount__contains=text)
for i in r1:
ids.append(i)
for j in r2:
if j in ids:
continue
else:
ids.append(j)
for k in r3:
if k in ids:
continue
else:
ids.append(k)
return render(request,'cheque/search.html',{'ids':ids})
Rudraksh
Help me to make it more productive
Alex
Maxim
Rudraksh
Maxim
Maxim
Nithin ask @pythonofftopic
Nithin
Ok
Alex
Jeff
Hi, I am new to web development and also new to dJango platform...I have created a custom field in my user registration page
Jeff
But the custom field doesn't save into my model... can anyone enlighten me>
Jeff
I have uploaded here
https://dpaste.org/TPJ1
Jeff
genres is the custom field I want to add
Jeff
Yes. I am thinking to create the case if form is not valid.. I planned to do it after settling this genres custom field
Sayidbek
Jeff
I am very new to web development... I am still figuring it out ..
Rudraksh
in any case, use set instead of list
def search(request):
ids=set()
if request.method == 'POST':
text=request.POST.get('searchQuery')
r1=Cheque.objects.filter(accountName__contains=text)
r2=Cheque.objects.filter(chequeNumber__contains=text)
r3=Cheque.objects.filter(chequeAmount__contains=text)
ids=r1.union(r2)
ids=ids.union(r3)
return render(request,'cheque/search.html',{'ids':ids})
Alex
I have uploaded here
https://dpaste.org/TPJ1
There is nothing I can see here. Probably there are some errors on validation step. So you better to either add a clause for that or use a debugger. Also, regarding your form:
https://docs.djangoproject.com/en/4.0/topics/forms/modelforms/#overriding-the-default-fields
https://dpaste.org/NTg2
Jeff
Thanks
Coding
I'm new to django
I'm building project where I'm using react for frontend and django rest framework for backend. Sqlite database.
I want to perform inner join between 4 tables. How to do that.
Jeff
cannot make migration after adding
AUTH_USER_MODEL = 'mysite.MyUser'
Richard
Hello to all
Richard
I'm building à new project with django and python.
Richard
However, when I start up Django admin I have not a good display.
𝔐𝔞𝔥𝔡𝔦 𝔉𝔦𝔯𝔬𝔲𝔷𝔧𝔞𝔥
Hello, any help is appreciated:
https://stackoverflow.com/questions/71193682/drf-serializer-integerfield-validation-to-make-sure-foreignkey-does-exists
Baqer
Hi 👋
I have problem when run command [ docker-compose up --build ]
And my error is :
Invalid mount config for type "bind" : invalid mount path : " " mount path must be absolute
Yusra
Hey there, I'm using Djoser and for activation user process, how do I send activation link to there email without specifying {EMAIL_HOST_USER,EMAIL_HOST_PASSWORD} in settings file?
Any help would be much appreciated.