Mirco
M
Hello guys i have a bulk delete with huge data its take long time to filter().delete() so i tried query.raw.delete(query.db) and still the same problem any suggestions guys
Charly
M
M
virat kohli
Can any one day how to add subdomain to a django server
virat kohli
Example : if we run server in django it gives like this https://127.0.0.1.com/home
But I need to like https:// example.127.0.0.1.com
virat kohli
Mohamed
how can I find good templates or projects for practice in python
Ehsan
virat kohli
virat kohli
My question is : if a user enters a value then that value be a subdomain to the url
virat kohli
Example if user enters home then url should become like home.127.0.0.1:8000
Ehsan
Mahmood
virat kohli
Mahmood
virat kohli
Can I use this
Mahmood
Yes of course
virat kohli
Ok
virat kohli
How to do this
Mahmood
https://django-hosts.readthedocs.io/en/latest/#
Mahmood
You can see the documentation here
Mahmood
Can you refer
For dynamic use it's middleware based in the host
virat kohli
Ok thank you
Gaurav
I am using djoser for user registration but I want that some user will bypass the email verification
𝙼𝚊𝚜𝚑𝚑𝚞𝚛𝚋𝚎𝚔
Hi. Can you recommend a better text editor than ckeditor?
𝙼𝚊𝚜𝚑𝚑𝚞𝚛𝚋𝚎𝚔
What is the best ?
Enang
Anshu
Mohamed
how can I find good templates or projects for practice in python
Ivanko ✙
Django is popular for making websites in 2023? Or not?
Riad
how default django url routing will perform if I use a separate frontend by django rest framework?
Dhanush
Invalid block tag on line 32: 'else', expected 'endblock'. Did you forget to register or load this tag?
Dhanush
can anyone help with this to rectify
Anurag
Check for spaces... And any extra braces
.
M
Anshu
Riad
class CourseMetaData(models.Model):
name = models.CharField(max_length=400)
price_total = models.FloatField()
modules_total = models.IntegerField()
price_per_module = models.FloatField(
editable=False, default=price_total / modules_total)
price_per_module is giving error saying: TypeError: unsupported operand type(s) for /: 'FloatField' and 'IntegerField'
what can I do to automatically calculate the per module price by division?
Rafael
Riad
Riad
def save(self, *args, **kwargs):
self.price_per_module = round(
(self.price_total / self.modules_total), 2)
super().save(*args, **kwargs)
Rafael
or you can write the method
for emample
Rafael
Maxim
Riad
Rafael
def calculate_price(self):
self.price_per_module=self.price_total/float(self.mofule_total)
and call it in save()
Riad
what does it matter?
how price_per_module will take input when editable is False? also, can you suggest a better way?
Maxim
Riad
Hunter
How to log in website using email id instead of username in django, and why do we use AbstractUser ?
DeViL
Hey I'm new here i know python
But i don't know how to start django
Can anyone help me .
From where i should start
And which course i should choose
Doragonsureiyā
DeViL
Riad
Munira
Hey guys I’m facing a problem related to django rest framework unit testing
Code & error message : https://stackoverflow.com/questions/75096832/django-unit-test-database-connection-error
I would be grateful if someone can help
Maxim
error occurs not in books.html
Suren
hi guys, I have a hotel booking form and that form shown in each hotel page. When someone fills it, a letter goes to me. But I want to send hotel name along in that letter. But the problem is I don't know how to get that hotel name.
If I do this :
hotel = Hotels.objects.get(pk=1)
I am able to get hotel name. But how can I get pk automatically for that form? In this case I know exact pk, but what if I don't know? As this form will appear on any hotel.
.
Starboi
Suren
This is what I mean, if I indicate pk, I am getting hotel name, but getting this pk automatically while using CrateView looks like a problem. I understand it is possible if not using class view
Suren
class HotelBooking(models.Model):
name = models.CharField(max_length=255)
email = models.EmailField()
check_in = models.DateField(verbose_name='Check-in')
check_out = models.DateField(verbose_name='Check-out')
persons = models.IntegerField(default=1, verbose_name='Persons')
message = models.TextField(blank=True)
created_at = models.DateTimeField(auto_now_add=True)
Suren
Y
Hello
I need some help, I had deploy my django project on pythonanywhere. But I want to update it with my github repository, I don't how process.
Someone's can help me please?
Suryo Adhy Chandra
Bhaghi
How deployment in django any videos please send me the video links
Mirco
Mirco
Y
M
Guys what better for bulk delete performance postgresql or mongodb or maybe others 🤔 !?
Matvey
Hello everyone, can you tell me how to make a global action. I want to make a form in the admin panel by which you can upload a csv file and update (according to my scenario) all the data. I can't find a solution at all.
UPD
It is not tied to any entity. The data is abstract, I want to preprocess it and write down the result of my calculations