Kumar Shreyansh
I'm build a filter option in django to filter student result data based on class name it's filter display the student names then based to filter student name and subject to display the that student result I'm getting a data but when I click the first filter like class name page was refreshing class_name was erasing how to fix it
When you click submit, it'll submit and then refresh the page by default. You need to use jQuery to fix this. To reset the form on submit, use on submit event or on click event. And to prevent refresh use preventDefault() method of Jquery
Shear
Do you have the image installed?
Yeah I do have both Dockerfile and docker-compose file on my project. Im try to access postgres via docker exec bash hence the error role 'postgres' doesn't exist
Rohan
And what are you trying to do exactly? Trying to access db service from where?
Shear
Can you share your docker-compose file via pastebin?
https://pastebin.com/CtchZaV9 here is the simple docker file and docker-compose file. everything is okay i dont know why im getting this Error: role 'postgres' does not exist
Shear
Your database has no users called postgres
I assigned the user to postgres on docker-compose file
Shear
Show your settings file
My settings file issue okay, every db settings is similar to that of docker-compose
Muflone
I assigned the user to postgres on docker-compose file
No, until you delete the existing database The environment variable won't recreate the database with the indicated user if it already exists
🄰🄼🄸🅁
Hi I want to install the pillow library but i got this error ERROR : Could not find a version that satisfies the requirement pillow ( from versions : none ) ERROR : No matching distribution found for pillow
Kaustab Roy_C_24_CSE(AIML)
upon migration I am getting this error, can anyone help me with this error? django.db.utils.OperationalError: (1054, "Unknown column 'sapp1_user.udept_id' in 'field list'")
Kaustab Roy_C_24_CSE(AIML)
Targoon
can i msg u?
of course
Doragonsureiyā
can i msg u?
Can i send you a private message? No. We do not provide one-on-one tutoring, hire someone if you need it. Questions are better answered in public so that everyone can learn.
Kaustab Roy_C_24_CSE(AIML)
of course
i will after sometime okay
Doragonsureiyā
cannot send images heerer
Rule 5️⃣: Never post walls of text or screen photos. Use paste bins like https://linkode.org, https://nekobin.com (or your favorite one)
Shear
Guys how does one handles media file when debug is false
.
Guys how does one handles media file when debug is false
One can setup Django with amazon s3 to store and serve media files
Adarsh
hey guys can you help me with this problem actually i want to iterate this values on frontend page using for loop but when i iterate this value they give me empty data
Adarsh
[{'question': 'What is the most common type of data analysis?', 'answers': ['Descriptive Analysis', 'Predictive Analysis', 'Prescriptive Analysis', 'Exploratory Analysis'], 'rightanswer': 'Descriptive Analysis'}, {'question': 'What is the purpose of data analysis?', 'answers': ['To identify patterns and trends in data', 'To make predictions about future events', 'To make decisions based on data', 'All of the above'], 'rightanswer': 'All of the above'}, {'question': 'What is the most important step in data analysis?', 'answers': ['Data Cleaning', 'Data Visualization', 'Data Modeling', 'Data Collection'], 'rightanswer': 'Data Cleaning'}, {'question': 'What is the most common type of data analysis tool?', 'answers': ['Spreadsheet Software', 'Statistical Software', 'Data Mining Software', 'Data Visualization Software'], 'rightanswer': 'Data Visualization Software'},] this is sample
vaseem cholakkan
hy how can i use drf serializer inside a asyncconsumer iam getting an error saying : you cannot call this from an async context, need to use @database_sync_to_async ? if so where ?
Anonymous
where can I host my django project for free just want to test something
Anonymous
pythonanywhere.com
thank you so much boss
Targoon
thank you so much boss
your wellcom bro
D.
Hi everybody
D.
Now, i need a django project , tanks everybody
vaseem cholakkan
how can i show a user is online on a websocket consumer ?
Anonymous
I wanted to make an update profile function where users can update their data by filling a form. My website is running well without any error, but whenever I fill up the form & hit submit the profile doesn't update itself & also new data is not saving here is my function in views.py: def updateProfile(request): if request.method == 'POST': profile_form = updateProfile(request.POST, instance=request.user.profile) if profile_form.is_valid(): profile_form.save() return redirect('profile') else: profile_form = UserProfile(instance=request.user.profile) return render(request, 'profile.html', {'profile_form': profile_form}) P.S.: I'm a beginner.
IGA
hi can someone help me do i need to activate (source myvenv/bin/activate) my venv every time before working on it? Becouse when i am not activating it my project not working correctly
Faraz
hi can someone help me do i need to activate (source myvenv/bin/activate) my venv every time before working on it? Becouse when i am not activating it my project not working correctly
Ya ot is necessary for all tasks to take effect, you can also try restarting webserver only for any changes to take effect.
Arash
Hello, I have a question I have to save some data in the database when the project is started, so I wrote it in the apps.py file related to it (method ready). Now, when I use pytest, it seems that this method is not executed! Do you know the reason and solution?
PraK
guys anyone worked on a simple products page like pet adaption platform etc?
Doragonsureiyā
guys anyone worked on a simple products page like pet adaption platform etc?
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
Berkay
Hello everyone, Can anyone suggest a Django course for beginners?
Anonymous
https://stackoverflow.com/questions/76842859/having-issue-to-update-user-profile-in-django
Anonymous
Help me please...
Doragonsureiyā
Hello everyone, Can anyone suggest a Django course for beginners?
Looking for Django tutorials? you can follow these three recommended ones: * Official documentation and tutorial * Tutorial from MDN * Tutorial from django-girls
Faraz
Hello everyone, Can anyone suggest a Django course for beginners?
You can learn from official @ this location: https://docs.djangoproject.com/en/4.2/
Kumar Shreyansh
how do you pass info as json?
Hi, you need to import the Json response module from django.http import JsonResponse Then you need to return JsonResponse, and pass the required data in the form of a dictionary. If you are passing a queryset, you convert it to list, before passing it through the function.
Kumar Shreyansh
In this case, you need a javascript function in the front end to handle the response. I use jquery to do the same.
Targoon
In this case, you need a javascript function in the front end to handle the response. I use jquery to do the same.
hello. thanks. another question :D what is the use of RESTful api? in django? should i learn it?
Kumar Shreyansh
hello. thanks. another question :D what is the use of RESTful api? in django? should i learn it?
Hi, in the case of RESTful API, yes you can learn it. As far as I know, it is widely used with Angular or React front end frameworks. I am still learning though, and I am implementing a development without these frameworks: using bootstrap 5, jquery for front end, and functional views in django.
Kumar Shreyansh
Targoon
Hi, I am a real person 😅😅
i don't think so. but whatever. be whatever you are
Maxim
Hi, I am a real person 😅😅
then stop adding "hi" to each message
Kumar Shreyansh
then stop adding "hi" to each message
I suppose it's a side effect of using too much chatGPT
Kumar Shreyansh
A piece of experience, even though i started learning django two months ago: I recently started using modelforms, minus the fact that i need to define class and id for each field separately which is quite tedious, it's really good. I have started using jquery to handle form submission and made a single function view for creating or updating the data which reduced a lot of time. The only hard part is to set the data in the form again when you are updating a record.
Kumar Shreyansh
Well in this case, i have been given a form with 5 models, and 20 columns per model. Is there an easy way to handle the submission of all the data when you are trying to update the model? There is an employee code which is common to all the models.
Dlight
Hey guys, I posted this question on stackoverflow no answer. Appreciate the help. I'm using CustomUser ( AbstractUser ) In Signup form I just want to have Email , no password . After we send a confirmation email , user can set the password how can I remove password in Sign up form?
ƑѦⴽⵊⵠƲƝ
I've got problem on API REST Framework I can't get access from remote machine but i set true to allow all access and i run manage.py runserver [my_ip] but still can't get access
Dlight
make a custom form with the fields you want, if there are required fields in your model, fill them with dumb data that your user can fill after signing up
This is my customform Class CustomUserCreationForm(UsetCreationform): Class Meta:   Model :CustomUser   Field =email
mani
Could you please tell me how can I generate a pdf in Django using restapi
mani
Use pdfkit
Ya but I want to use rest api
vijay
Yes u can
vijay
Djsngo is also python
JairamJavv
Hi folks, I am trying to deploy my Django project for the first time. It has a NoSQL database connected and just storing and retrieving my data. Which service should I choose? I need some help in deploying my project, please can anyone help me out?
Ashraf
Hi everyone. What's the best server for hosting web site Django and database postgreSQL?. What is the average cost?.
Anonymous
Can anyone say what is the fault in this function? https://codeshare.io/N3zPx4