Anurag K
How to upload multiple image in django
Siddharth
How to upload multiple image in django
You have to write multipart/formdata in you HTML form
Nishanth Siraj
Hi i know django serializers.Serializer and model serializer. Should i need to learn hyperlink serializer too ? Coz most of basic stuffs are solved by those 2 serializers . Thanks in advance
Yash
Hi, I have basic knowledge of python and frontend ( html, css and js) and wanted to start with django and databases for fullstack development. Can anyone suggest me the resources for the same, like from where i should start. Any course or youtube channel. It will help a lot.
Human
Hello we are doing some basic academic projects. So currently to store files we are using FilesystemStorage and put the location path manually. The challenge is that while shifting the project to another system, it forces to change the path too.. So any better option?
Ahmed kamal
i have migration problem, any one can help please!!
Doragonsureiyā
i have migration problem, any one can help please!!
No one can help you until you explain your difficulties.
Y
Hello Basically I am beginner of django I create a login sign up page in local server(8000) ,it's working very well, now I want do sign or login with Google Account How can I do this?
Ahmed kamal
i make a basic 1 to many db relation as bellow class Product (models.Model): name_Product = models.CharField(max_length=50) def str(self): return self.name_Product class Client (models.Model): name_Client = models.CharField(max_length=50) Products = models.ForeignKey(Product, on_delete=models.CASCADE) def str(self): return self.name_Client __ and the termnal output is: ‼️table pages_client has no column named Products_id
Ahmed kamal
The client has no Products_id field only a Products one
Intermediate table which created to support the relationship has these: •id •client_id •product_id so can u explain to me what i need to do
Ahmed kamal
Show the code that is using this models
nt code, im using the django admin panel to add a client
Ahmed kamal
For Foreignkey a separate table wont be created. Are you changing onetomany to foreignkey ?
i change from many to many ~ 1 to many, i change the 2 tables name swap the relationship between them
Ahmed kamal
i try to migrate zero to delete the db no changes happens
MindSlayer001
Does anyone know how to deploy a django application in versel
MindSlayer001
I am a beginner in django, I tried watching different YouTube tutorials but nothing makes sense
⚜️आशीष⚜️
Igor
Good evening, I am currently struggling with a need to add verbosity to the migrate execution. Does Django contain any mechanism (not important whether it's internal not well-documented approach or external public api) to add hook for the start-end of each migration that is being executed? So far, I've found only the option to add global hooks by inheriting the Command (from django.core.management.commands.migrate import Command), but this is not enough since it only allows to add a hook before all migrations are executed and after all migrations are executed If that's important: - Python 3.11.3 - Django 4.1.4
Igor
hello... you can see the migrate history in migrations directory in your app
Oh, no-no, I need to handle programmatically the beginning and the end of each migration (e.g. check that tables have been actually created afterwise)
Igor
you mean, can control what table had been changed after migration, like that?
I mean, I need a callback for two kind of events: - another migration is to be applied - it's applied
Suryo Adhy Chandra
I mean, I need a callback for two kind of events: - another migration is to be applied - it's applied
in the case, if there is some programmer make migrations into one database?
Dutchq
Hello good morning, please I want to know is it possible to creat a website with django without use a database? just like using a template display pictures and Text but with different pages?
Dutchq
Yes you can
ok, thanks meaning I will just work with templates right?
Dutchq
And views and urls
I thought we use views is when u have a model u want to be displayed on the template?
Believe
But you need views to render the correct template according to your url
A
How to create multiple type user in Django?
Anonymous
i have a problem about creating object by model without admin panel
Алексей
how cache image in django. using whitenoise, cloudinary...
Karthik
Does django provide some sort of form validation? Can someone tell me where can I find about this.
Karthik
check the official django docs
ok, lemme try to find it in docs. thnx
experes
Hello friends Does anyone know why when I change the Django database to postgres, then when I command run server or migrate, Django does not give any response. It doesn't even give an error Does anyone know what to do?
Mr
Hello Can anyone suggest me a root map to start django
麦当劳
I am having a slight problem with uploading a file to a django backend
Doragonsureiyā
I am having a slight problem with uploading a file to a django backend
No one can help you until you explain your difficulties.
麦当劳
whenever I try uploading the file as part of a form all the other fields get registered properly But the the server says "file [ "Please upload a valid image." ]
麦当劳
Hi, I am trying to upload an image to a django backend running on django==3.2.5 and djangorestframework==3.14.0 , I am trying to upload an image to an imagefield but django returns a 400 error code saying "file [ "Please upload a valid image." ] " I have tried multiple Image formarts (png,jpg,jpeg) but they all return the same error. Please let me know if you have any suggestions
麦当劳
let's see your serializer
https://dpaste.org/Xjuom
H.G.
https://dpaste.org/Xjuom
According to your serializer, you should send base64 encoded value of image to your Django API
麦当劳
Yes
H.G.
Yes
so are you doing that?
麦当劳
According to your serializer, you should send base64 encoded value of image to your Django API
So the problen is that the request i am receiving is a either string like ""blob:http://192.168.1.43:3000/2b3efea7-4883-4063-afe5-f7fff2e985c9" or a dict like {"source":"blob:http://192.168.1.43:3000/2b3efea7-4883-4063-afe5-f7fff2e985c9","name":"gyuy.jpg","size":432292,"file":{}}
Meshack
Any django task
麦当劳
How do I do that ? Do I update the serializer or the views ?
H.G.
How do I do that ? Do I update the serializer or the views ?
on the frontend, encode the image before you send it to django
麦当劳
Thanks, Let me try
麦当劳
on the frontend, encode the image before you send it to django
It didnt work, but thanks for your help anyways
H.G.
It didnt work, but thanks for your help anyways
how are you encoding it? also send what it looks like after the encoding
Maxim
Any django task
what are you talking about? this is neither a job board nor a bulletin board
麦当劳
After encoding it using javascripts " encodeURI() " function I am getting a diferrent errot string indices must be integers
Dutchq
Hello please I have a difficulty, I have sent my code to git successfully but now when I try to pull from pythonanywhere I doesn't update the files in pythonanywhere, how can I solve that please
麦当劳
Hello please I have a difficulty, I have sent my code to git successfully but now when I try to pull from pythonanywhere I doesn't update the files in pythonanywhere, how can I solve that please
pythonanywhere doesnt automatically reload you have to go back to your daxhboard and click the green reload "appname" Button