models.py from django.db import models class Images(models.Model): def upload_path(instance, filename): return '/images/'.join([filename]) im
I've setup a relationship using django's ForeignKey against 2 unmanaged tables like so: class Product(BaseModel): publish_name = models.CharField(unique=Tru
I want to separate the files in my models based on extension type. Right now I am able to print all the files but now I want to separate them based on extension
class ObjectSEO(models.Model): object= models.ForeignKey(Objects, related_name='seo', on_delete=models.CASCADE) meta_description = models.CharField(max_
I am relatively new to Django so I am likely doing something obviously wrong but I cant seem to figure out what exactly. I have a model called Report and this h
I am currently working on a job portal project, where I need to create 2 profiles based on is_staff field of default user model of django. one for job seekers a
Suppose I have 3 fields of a Car Shop. those are Condition, Brand, Model . class Car(models.Model): ConditionType=(('1','New'),('2','Used'),('3','Reco
I have this model: class AnlieferungKopf(models.Model): kopfNr = models.AutoField(primary_key=True) firma = models.ForeignKey( Firma,
I wrote a project in django framework and I use the local DataBase SQLite, and I now want to upload it to the cloud so other people who work with me can access
I have changed the input's name attribute to some custom name, but the view calls form_invalid method. Why my Form isn't saving (validating)? html: <tr>
As soon as the django user_logged_in signal works, I want to send data to my template at that moment.I need to check if my signal is working. from django.contri
The problem I am trying to solve is to export all the entries of a Django model as CSV. The field names are supposed to be headers, with each row having an appr
I followed YouTube Django E-commerce video, I did exactly the same as the tutorial. But I found some difficulty in certain code. CONTEXT_PROCESSORS.PY from .mod
I am trying to display some extra context on the page, but when I adding get_context_data method it is displayed context but not a forms fields. This is because
right now my template looks like this I wish to use those cards as the choices in the form that is on the right side. i am a newbie so i cant figure out how. is
my problem is that the login operation is done correctly and the session is set up correctly, but user.is_authenticated does not work. The point is that it work
Using Django/python. So I have a 'food' model that is taking multiple user inputs, one of which is 'type' and has the options of 'fresh' and 'pantry'. Another i
I have model with manytomany field and the task is to make an validation in model layer. When i run this code, this error occurs: ValueError at /admin/main/boss
[enter image description here][1] [1]: https://i.stack.imgur.com/2wDSL.png NameError! I am following Django tutorial in part 5 when try to run test, getting e
Error When Click Button for send data. Please Helping me to solve problem. Error When Click Button for send data. Please Helping me to solve problem. Error When