M
I put the site on hosting, the hosting itself requires all the paths to the static files, but I don’t know the paths to the static files of the admin application, how can I find them?
Qwerty
Zelalem
TypeError at /admin/
'set' object is not reversible
Request Method: GET
Request URL: http://localhost:8000/admin/
Django Version: 5.0.2
Exception Type: TypeError
Exception Value:
'set' object is not reversible how to fix this error
Qwerty
Papy
Devendra
Devendra
but this error i facing when try to access admin pannel
Qwerty
Devendra
silvio
Hi, I want learn Django for create a professional app. The way it's ready documentation and in the next step create a project?
Anonymous
Whiterose
Guys, I have several forms, Company, Address, Partner, etc...
I need to send them to a registration page, I'm managing to do this, but I feel like my code is complex.
Do you think using a Wizard system would be more interesting?
Whiterose
What do you use for these cases?
٩ʕ•͡וʔ۶
how do I make an index to search for icontains by model field?
Alex
٩ʕ•͡וʔ۶
what?
the model has a name field and needs an index for this field in postgresql
Qwerty
Qwerty
Rose
User Redhat has 1/3 warnings; be careful!
Reason:
offtopic and crossposting
Rama Krishna
Hello I need help in running a django project (e voting with face recognition)
Rama Krishna
I already have the code but I'm facing issues while running it
Alex
Rama Krishna
Production
Rama Krishna
The group isn't letting me add images, could you dm me please
Alex
Charly
Andrew
I want the systems to be built in Django, that's why I'm asking in a Django group
Andrew
Ok, I'm sorry
Eudes Gaël
C:\Users\Fantas\Desktop\ProgrammingKnowledge\monpro>python3 manage.py runserver
Python is nie gevind nie; laat loop sonder argumente om vanaf die Microsoft Store te installeer, of deaktiveer hierdie kortpad in Instellings>Bestuur aliasse van toepassinguitvoering.
Eudes Gaël
How can solve this?
Eudes Gaël
I'm trying to view my djang app, but this what I getting as a message.
Eudes Gaël
After typing Python3 manage.py runserver
northern
look at docs.
Charly
Rose
User shais has 1/3 warnings; be careful!
Reason:
nonsense message
Kevin
How to generate html to pdf in django.
Farman
How to mongodb in settings same as SQL ?
Eudes Gaël
Qwerty
How to mongodb in settings same as SQL ?
```
DATABASES = {
'default': {
'ENGINE': 'djongo',
'NAME': 'your-db-name',
'ENFORCE_SCHEMA': False,
'CLIENT': {
'host': 'mongodb+srv://<username>:<password>@<atlas cluster>/<myFirstDatabase>?retryWrites=true&w=majority'
}
}
}
```
It’s optional. U can use mongo engine and connect to your atlas or localhost.
Mirco
Mirco
Alex
Rose
User Mohamadamin... has 2/3 warnings; be careful!
Reason:
rule #1: speak English
Ædel
hi,
In django rest framework, i'm using update_or_create() based on two fields from my model.
check the request, if the values for field1 and field2 already exist, update the instance. if not, create.
it works as expected (using postman or the built-in browser app) but when i use it from a TV that constantly requests, it ignores the condition sometimes, and creates two similar objects. (similar in the value of those two fields).
how can i debug/solve/investigate this?
is this due to race condition? a server problem?
Maxim
Ædel
Rose
User saruma🇺🇸 has 1/3 warnings; be careful!
Reason:
useless messages
-
Hlo anyone help me
Rama Krishna
Specify the problem
-
Only the user who added a post can modify or delete it.
Rose
Shubhtiwarii
I need on help in authentication token login or signup.
Anonymous
Shubhtiwarii
I was done the token based authentication api on back-end logic but I am facing issues to use from frontend.
shais
btw why are you setting is_reply ?
Shubhtiwarii
Kk
Hello I need some help.😶
Rose
I am facing issues in script tag to send data from frontend.
Please provide a full explanation including all the details that you consider relevant. Your statement is too broad and there is no clear way to answer you, you have to explain:
- what you're doing
- what you're expecting
- what you're using
- where you're running the script
- what Python version you're using
- what packages and their versions you're using
- and the most important thing: show the code YOU wrote (read rule 5️⃣ for that)
and more details, that way your chances to get help will increase.
Rose
Rose
User Khushboo has 1/3 warnings; be careful!
Reason:
do not send PMs without the recipient's consent; ask the person in the group first (rule #9)
Kk
I will giving you the full details about the topic why the error is coming I couldn't understand it.
Maxim
Kk
Kk
салли
class Product(models.Model):
user = models.ForeignKey(get_user_model(), on_delete=models.CASCADE)
title = models.CharField(max_length=120)
content = models.TextField(blank=True, null=True)
price = models.DecimalField(max_digits=15, decimal_places=2, default=99.99)
public = models.BooleanField(default=True)
quantity = models.IntegerField(default=0)
category = models.ManyToManyField(Category, null=True, blank=True, related_name='products')
objects = ProductManager()
class Sale(models.Model):
size = models.DecimalField(max_digits=4, decimal_places=2)
end_date = models.DateTimeField(default=datetime.datetime.now() + datetime.timedelta(days=7))
product = models.ForeignKey('Product', on_delete=models.CASCADE, related_name='sale')
def __str__(self):
return f'Sale for {self.product.title} {self.size}%'
Pls guys help. i have this 2 models. How can i fetch queryset of products so that product serializer would not make query for each product to get its sale size
Shubhtiwarii
I think select_related help you.
Anonymous
class Product(models.Model):
user = models.ForeignKey(get_user_model(), on_delete=models.CASCADE)
title = models.CharField(max_length=120)
content = models.TextField(blank=True, null=True)
price = models.DecimalField(max_digits=15, decimal_places=2, default=99.99)
public = models.BooleanField(default=True)
quantity = models.IntegerField(default=0)
category = models.ManyToManyField(Category, null=True, blank=True, related_name='products')
objects = ProductManager()
class Sale(models.Model):
size = models.DecimalField(max_digits=4, decimal_places=2)
end_date = models.DateTimeField(default=datetime.datetime.now() + datetime.timedelta(days=7))
product = models.ForeignKey('Product', on_delete=models.CASCADE, related_name='sale')
def __str__(self):
return f'Sale for {self.product.title} {self.size}%'
Pls guys help. i have this 2 models. How can i fetch queryset of products so that product serializer would not make query for each product to get its sale size
instance.sales.count()