Astrapel
Hello, I tried to insert multiple values (bulk) and used "post.getlist" data but when I tried to get data such as "integer" value return like this = value="['1']" this value(error value) is coming from "html"(print) and error comes from "form validation" and return "error for "please enter number" and I don't understand why am I getting this value instead just "integer "number" the input I used is "number" type code : https://paste.ofcode.org/39n3m7mTHRLRdtz2pAUWgBH
Anonymous
Pixelated
There's no way to do it in django? Without js?
You have to submit data as forms if you want to do it as far as I know
Pixelated
Something like this first_name = self.cleaned_data['fieldname']
Anonymous
Can i get Account on AWS without cc?
Jimmies San
Anonymous
Do online shopping site
u have an example
Anonymous
I have deployed my django project on pythonanywhere all is working fine except media url It's working in local but not on production
Anonymous
It is working when DEBUG is TRUE in production
Loki
I am getting wrong path while updating image in website in Django
Loki
How can i fix this
Anonymous
How to make cart in django
Anonymous
I always confuse on one thing Def order(self,**kargs)
Anonymous
What **kargs is doing
Anonymous
I have never seen value is pass there
Mirco
What **kargs is doing
A better study of python is recommended
Rohan
I have never seen value is pass there
Well, maybe it's time for you to google *args and **kwargs
Anonymous
Debug must be false! In prod
But on false...it show 404 on media files
Rohan
But on false...it show 404 on media files
Cuz you need to collectstatic
Rohan
Also if you're using dockerized setup, use a volume mount
Anonymous
But static files are working fine
Rohan
But static files are working fine
You just said when you trip debug to false, static is gone
Rohan
Media is gone
https://docs.djangoproject.com/en/3.0/howto/static-files/deployment/
Anonymous
https://docs.djangoproject.com/en/3.0/howto/static-files/deployment/
It is setup correctly and working fine in local but media files not working on production on pythonanywhere.com but working on production when debug is True
Anonymous
Ok
Milan
It is setup correctly and working fine in local but media files not working on production on pythonanywhere.com but working on production when debug is True
Probably caused by missing some static files or an incorrect path. Enable logging in settings for production too and check out which file is causing the issue and fix it.
SJA
Hello guys pls is there any opensource Counseling system with django
Gio
Happy new year guys
Zerihune
Hello guys does anyone hv a clue about object based permission in a model
Swapnil
I want to create registarion page but my data is not push into database
Anonymous
I want to create registarion page but my data is not push into database
Be more specific, check server logs for any errors
Anonymous
Why i have to use get_object_or_404 Instead we can use Product.objects.get(id)
Muslim
Why i have to use get_object_or_404 Instead we can use Product.objects.get(id)
Avoiding not found or multiple found exceptions with 404
Anonymous
Ok if product is not found it will not give error
Anonymous
In database
xarala221
Why i have to use get_object_or_404 Instead we can use Product.objects.get(id)
I use all these two : get_object_or_404 Return 404 error if Django don't find the object . Modal.objects.get(pk=id) Throw an error of type DoesNotExist if Django don't found the object.
Meh
Ik that we can use some free css and html templates to design a webpage. Can such thing also be found in django?
Mirco
Ik that we can use some free css and html templates to design a webpage. Can such thing also be found in django?
If you need to build just a simple static website, you don't need Django
Meh
If you need to build just a simple static website, you don't need Django
No its not static. The code has been written but needs styling
Mahi
Hi everyone, I want to learn and work on pyspark or python rest apis. I dont have much idea which is good to learn as per market requirement.Could you please suggest me which is good to learn and how can I learn it from scratch. ? Or anyone have stuff in these topics. If yes, please share.
Mirco
No its not static. The code has been written but needs styling
😓 And styling for u means using a framework like Django ?
setiawan
excuse me, I want to ask? I have a problem appearing writing "unable to import django.shortcuts pylint (import-error)" I have tried installing pylint in virtual env but it's still an error in the visual studio application, what's the solution?
Anonymous
How to get the name of a foreign key in an objects.all querry with an annotate count? I get the counts correctly but the ids of the foreign keys is showing instead of the value
Batman
Hello guys does anyone hv a clue about object based permission in a model
https://github.com/django-guardian/django-guardian
Anonymous
What is asgi in Django 3.0?
Eric
What is asgi in Django 3.0?
Asynchronous WSGI replacement used by Channels
Eric
Channels?
https://channels.readthedocs.io/en/latest/index.html
Rohan
Channels?
Let me 🦆 DuckDuckGo that for you: 🔎 django channels
Anonymous
It is used for routing like blog.something.com to main url
Anonymous
Can I make asynchronous something in Django using asgi like Ajax do then?
~
Can anybody help me out➡➡🔼.. . I have a problem that i know how to get value of selected radio button but don't know how to get value or text of hyperlink that selected or clicked in html template in *django*
Mirco
Use a pre_save signal to make that calculation using a timedelta and then save it into the field
Mirco
Why not a DecimalField where saving this calculation ?
Mirco
You wanna save into the db that interval or not ?
Mirco
Ok so you need a field to save the calculation Think better which type of field you want for that value But the main stuff you asked for is how can do the calculation A pre_save signal could be a strategy
Mirco
Before saving into the db you can make the calculation performed by backend
Mirco
Yup, but have a look at signals They can do nice stuff 😊
Mirco
It's like when you wanna create a custom slug before saving.into the db
Mirco
Without saving it into the db, how can u use that duration in some other parts of your app ?
Mirco
get duration makes sense by retrieving it from db as well
Mirco
It depends on your needs
Mirco
It accepts timedelta
Mirco
Frontend is another stuff You have to process that value into a view and give to the frontend the correct format
Mirco
By using the pre save signal you can get the value of the first 3 , make the calculation into the 4th and then it will save your instance
Mirco
For the frontend part, you will get from db that value and format as u want