Sopan
Wrong username
Opps.. so sorry
Axror
But this issue have not fixed
Axror
Send your models
class Product(models.Model): name = models.CharField(max_length=256, unique=True) price = models.FloatField(max_length=50) description = models.TextField(max_length=1000) type = models.ForeignKey(ProductType, on_delete=models.CASCADE) image = models.FileField(upload_to='product_picture/', blank=True) def str(self): return self.name
Axror
thanks everyone
Axror
I fixed this issue
Sopan
I fixed this issue
So what was the resolution? - makemigration was not ran? - pointing to wrong db?
Axror
then I deleted my sqlite db and re-migrate and fixed issue😊
Axror
then I deleted my sqlite db and re-migrate and fixed issue😊
I am sorry for my mistakes. I don't know English well
Lucid
https://del.dog/ughymimafa.txt
Lucid
Please have a look on this model what is the mistake in getitem function doing relative grading
Lucid
In same function whenever I use absolute grading it works but for these if_else statements it is not returning anything in database
Sumit
Hi, I am receiving ResourcesWarning is not found
Sumit
I am running django over apache
Sumit
It is working fine with runserver
Anonymous
How to use django model translation in rest framework?
Anonymous
Could you send me example?)
Sumit
My website is also seems very bad because of this error probably, because everything working very fine with runserver but not with apache
âshîsh
Query I want to upload multiple pdf files from Django Admin. Right now only able to upload 1 file at a time. Conditions: 1) don't want to create different fields for multiple file uploads (what we do with foreign key) 2) don't want to go with forms.py or customisable html field. Just want to select multiple files at a time from Django Admin panel (admin.py) and upload.
Alex
Query I want to upload multiple pdf files from Django Admin. Right now only able to upload 1 file at a time. Conditions: 1) don't want to create different fields for multiple file uploads (what we do with foreign key) 2) don't want to go with forms.py or customisable html field. Just want to select multiple files at a time from Django Admin panel (admin.py) and upload.
How does django store uploaded files at all? It places them in the media folder in the path you specified in upload_to parameter of a FileField. So actual files are stored on your hard drive. How does it related to DB? In a DB you store full relative path to a file. So it's actually a string. See the doc So to your question on how to store multiple files in your model - you should have a way to store multiple strings representing path to a file on your hard drive. But if you simply want to use a single html input to take multiple files - here
Mendes
try <input type="file" name="filefield" multiple="multiple">
Mendes
the multiple="multiple" will do the job
âshîsh
Nah, not html. That's easy. Directly from admin panel.
Mendes
I didn't saw the earlier message, reading it now
Mendes
those conditions are harsh, I'm not qualified to help
âshîsh
Alex
Nah, not html. That's easy. Directly from admin panel.
As far as know, there is no such built in tools for that. Or you can add you js and make what ever you want with the DOM
Alex
Can we deploy JS to admin panel ?
Can you read what I said?
Saila
Thanks mukul , I am facing some redirect issues and trying to fix it but it's not getting resolved
thenils
Account email verification is mandatory now when i confirm the link it will take me to page not found
Lucid
mukul
I am using
In average also
Lucid
In average also
Else logic is correct
Lucid
In average also
Still empty
mukul
Still empty
Use print statement
mukul
Step by step
Lucid
In the if else block?
Hossein
Hi guys i'm using rest api in my project and i'm using ckeditor for my articles. In the ckeditor i use images and text. But my UI colleague says i can not give the image and text seprated and style them . What should i do??
mukul
In the if else block?
Use print statement where you have doubt
Cacio Lucas
Guys, I have a simple Function View with a Json response, I want to filter the response based on parameters sent with Post. I'm not using csrf, but I'm using DRF, it's a custom json. What would be the easiest way to do it?
Axror
Good night everyone. I have a problem, too. I cannot get image from object in template. My code (<img class="img-fluid" src={{type.image.url}} alt="No image" />). Please, help me!!!
âshîsh
src=static/file_path/file_name
Akhil
I have to make a project on airplane online ticket registration
Akhil
So for this which database should I use
Akhil
Djnago by default or MySQL or something
Akhil
Anyone ??
Naol
django by default uses sqlite, which is shiped with a website or software but mysql can be deployed on decentrised network, mysql is a better choice
Akhil
Because for MySQL I want to configuration first
Naol
it offloads a read and write operation from the web server and by having separate db server
Akhil
Ohk thanks bro
âshîsh
Djnago by default or MySQL or something
Postgresql is perfect for rich data
Naol
probabliy the web host you use might be usign distributed db server
Alex
!report
Alex
Djnago by default or MySQL or something
From the very first versions django was intended to work with postgres. Even today you can notice that it's supported better without any 3rd party packages. https://docs.djangoproject.com/en/3.1/ref/contrib/postgres/