theDisgrace
ky
Ok
ky
Thank you
theDisgrace
theDisgrace
There are two more steps then.
ky
Yes now working
theDisgrace
Semyon
Hello, guys. I have Full text search in my project and I try to save instance into db. Get this error:
SyntaxError: cannot insert into column "vector_column"
DETAIL: Column "vector_column" is a generated column.
But I didn't fill this column, when create instance :(
Adhil latheef
I need to filter objects created after last April....if current year 2022 Jan....need to get all objects from 2021 April?
If 2023 jan....need to get all objects from 2022 april
Anonymous
hello folks, i need help regarding media file
Anonymous
I got error while reading media files....that bo such file or directory
Arvindhan
Shilpy
How can we display long strings in multiple lines on admin panel
Ghorz
Adhil latheef
Go for raw SQL query
if datetime.date.today().month <= 3:
startdate = datetime.datetime(datetime.date.today().year - 1, 4, 1)
enddate = datetime.datetime(datetime.date.today().year, 3, 31)
else:
startdate = datetime.datetime(datetime.date.today().year, 4, 1)
enddate = datetime.datetime(datetime.date.today().year + 1, 3, 31)
self.voucher_code = Payment.objects.filter(
payment_date__range=[startdate, enddate]).count() + 1
self.save()
This was my solution......
Ghorz
Ghorz
Friend*
Amit
TypeError at /createprofile
'MultiValueDict' object is not callable
Request Method: POST
Request URL: http://127.0.0.1:8000/createprofile
Django Version: 3.2.9
Exception Type: TypeError
Exception Value:
'MultiValueDict' object is not callable
Exception Location: C:\Users\mohan\Desktop\New folder\Resume\Resume\resume_amit\views.py, line 44, in profileform
Amit
i got this error while form submiting
Charly
Amit
def profileform(request):
if request.method == "POST":
name =request.POST.get('name')
mail_id =request.POST.get('mail_id')
mobile_number =request.POST.get('mobile_number')
about =request.POST.get('about')
address =request.POST.get('address')
interest =request.POST.get('interest')
profile=Profile()
profile.profile_img =request.FILES('profile_img')
profileform =Profile(name=name, address=address, profile_img=profile.profile_img , mail_id=mail_id, mobile_number=mobile_number, about=about,interest=interest)
profileform.save()
profile.save()
return render(request, 'createprofile.html')
Amit
i m using this code
Charly
Amit
Amit
MultiValueDictKeyError at /createprofile
'profile_img'
Request Method: POST
Request URL: http://127.0.0.1:8000/createprofile
Django Version: 3.2.9
Exception Type: MultiValueDictKeyError
Exception Value:
'profile_img'
Exception Location: C:\Users\mohan\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\django\utils\datastructures.py, line 78, in getitem
Python Executable: C:\Users\mohan\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\python.exe
Amit
this error showing
Charly
Amit
ok so what can i do now
Amit
if request.method == "POST":
name =request.POST.get('name')
mail_id =request.POST.get('mail_id')
mobile_number =request.POST.get('mobile_number')
about =request.POST.get('about')
address =request.POST.get('address')
interest =request.POST.get('interest')
profile_img =request.FILES['profile_img']
profileform =Profile(name=name, address=address, profile_img=profile_img , mail_id=mail_id, mobile_number=mobile_number, about=about,interest=interest)
profileform.save()
profile.save()
Charly
Jerome
Doragonsureiyā
Check out PythonRes, a channel for Python resources - video courses, pdf books, tutorials and other info to help you learn Python.
Doragonsureiyā
Looking for Django tutorials? you can follow these three recommended ones:
* Official documentation and tutorial
* Tutorial from MDN
* Tutorial from django-girls
Дауран
asawer
Peace be upon you guys
asawer
I want to make multiuser api and every user have his model
Maxim
asawer
No‚ every type of user have model
Abdulrasheed
Hello guys
I create a model that have a field of imagefield so anytime I am trying to upload an image to this field in my admin page it will be telling me error 38 function not implemented
Please help me out
Abdulrasheed
This is the exception
https://dpaste.org/ByzH
Javokhir
hi everyone I have a question, I have wrote api in restframework, but I didn't understand, who is responsible to connect it with app.js file? who write code in app.js file? frontend developer or beckend developer
Javokhir
Hasan
Сергей Новиков
Hi guys, tell me how to write a ternary operator in Django correctly?
{% swipe ? 'swipe' : '' %}
Jerome
Abdulrasheed
Syed
How to fetch record of 10-10 in table from django database after 10 record I can see another 10 record
Sufiii
Can someone help with web app error?
Doragonsureiyā
Can someone help with web app error?
Don't ask meta questions like:
"Any user of $x here?"
"Anyone used technology $y?"
"Hello, I need help on $z!"
Just ask directly! The better you are at explaining the problem, the more likely you are to get help.
Asking smart questions
Sufiii
When I'm doing cv2.imread() its opening a seperate window, I want that window to be opened in to my webapp i.e. chrome
kam
What is better to use for a website backend, Django or Django REST?
In django front-end is kinda built in to the codebase. If I separate backend from front-end via API won't it be better in a long run? Because later I could use this API for mobile apps without ever changing the backend.
Suppose I want to build a website first and later cross platform online mobile app. I am building website with DJango as a back-end and later will have to make REST API for apps. When doing apps I will have to adapt django to rest or it is not that hard to make django backend to REST api?
Mirco
Anonymous
TypeError at /users/signup
CustomUsr() got unexpected keyword argument 'initial'
Anonymous
Samaneh
Hi guys.
Iv created a form for login and i want to use confirm password for my form so i defined a func to clear data and compare password and confirm pass. i used a form.validationerror to show the error but after i try i cant see any error massage.
Ramin
Mirco
Samaneh
for more description this is my form
class ProfileRegisterForm(forms.ModelForm):
first_name = forms.CharField(max_length=100,error_messages={'required':"enter your name"})
last_name = forms.CharField(max_length=100)
username = forms.CharField(max_length=100)
password = forms.CharField(widget=forms.PasswordInput)
confirm_password = forms.CharField(widget=forms.PasswordInput)
email = forms.CharField(widget=forms.EmailInput)
profileimage=forms.ImageField(required=False)
class Meta:
model=ProfileModel
fields=['profileimage','gender']
def clean(self):
cleaned_data = super(ProfileRegisterForm, self).clean()
password = cleaned_data.get("password")
confirm = cleaned_data.get("confirm_password")
if password != confirm:
raise forms.ValidationError(
"password and confirm_password does not match"
)
Anonymous
Hello friends. Please send a drf project that used mobile for authentication. Or guide me on how to implement it
Maxim
Maxim
what are you talking about?
are you @Hossein_th13?
Sanket
I need help for insert update delete using ajax
Doragonsureiyā
I need help for insert update delete using ajax
Don't ask meta questions like:
"Any user of $x here?"
"Anyone used technology $y?"
"Hello, I need help on $z!"
Just ask directly! The better you are at explaining the problem, the more likely you are to get help.
Asking smart questions
Sanket
How to delete record using ajax
Shabaz
When I'm doing cv2.imread() its opening a seperate window, I want that window to be opened in to my webapp i.e. chrome
ㅤ
Hello guys, I need help in solving a JSONDecodeError, can anyone help me solve it. Basically I am trying to send a POST response of the PayPal payment details that generated while payment, to a view inside a Django app. Inside the view I m trying to deserialize the stringified data using json.loads(request.body). Now the whole process runs smoothly without any issue in localhost , but once I m. Trying to do the same stuff on live server over internet it breaks at that line in view( the one I mentioned a while ago) and I receive a JSONDecodeError. Now the problem is I am unable to get the output of json.loads(request.data) on live server. So I m really confused.
Nilesh
django is stack or framework ?
Rohan
Javokhir
cj
Naabe
ㅤ