Rangarajan
Hi, Is it possible to host React app with Django Rest Framework as a backend on CPanel? I know how to host Django and React on cpanel separately but I don't know how to deploy a django + react app on Cpanel
Ali
Hi Is there any tutorial for how can we make our app to support many servers?
Ali Hasan
Hi, Is it possible to host React app with Django Rest Framework as a backend on CPanel? I know how to host Django and React on cpanel separately but I don't know how to deploy a django + react app on Cpanel
I haven’t dealt at all with CPanel before and I don’t know what it is tbh, but I deployed a django abd react on a server using nginx where I made locations for django (static, media,api,…) to point to gunicorn socket and a single location for react app which points to files in the built bundle and it did work.
Ali
What do you mean by servers here exactly ?
For example Instagram , there is many servers for uploading post or etc but all connected to each other
Ali Hasan
For example Instagram , there is many servers for uploading post or etc but all connected to each other
It is not about supporting many servers , you need to look for what is known as distributed systems I think
Dostow
HI everyone, does someone knows how to put a select populated with countries (django-countries) in a django form using django-filters? https://ibb.co/TgQwmR7
Dostow
thanks
David
Hi all! In Django, the add button is hidden on mobile, do you know what CSS property I should add/change so that it is not hidden on mobile?
David
The add button located next to the related model inputs
Snsn
HI. Does anyone know how to hide html from the DOM but still show it. So you have a div and that div is empty but in there is somehow the HTML dynamically allocated. So it prevent people from copying your website.
Юлиан🦉
hello every one, who knows what is the thing about 2 different packages 'django-rest-framework' and 'djangorestframework' ? Isnt 1st one malicious , suppoly chain attack?
j4n
What's the best way in Django ORM to call SELECT COUNT(id) FROM table where table.created > CURRENT_DATE LIMIT 1 in order to compare it to 0
j4n
something like if Product.objects.first().count() > 0
Muhaimin
Is there any good video for beginner, intermediate and advance to learn Django? And I have problem when Debug = False.
Doragonsureiyā
Is there any good video for beginner, intermediate and advance to learn Django? And I have problem when Debug = False.
Looking for Django tutorials? you can follow these three recommended ones: * Official documentation and tutorial * Tutorial from MDN * Tutorial from django-girls
Kamlesh
Any one know how to add Bcc in emailmultialternative django
Kamlesh
Yes
Abdullaev
Guys how to use django-sendfile with nginx. In nginx config when i put "internal" into location of private media, i get 404. I don't know what to do
NITIN
Anybody here who has worked on generics api view ?
Doragonsureiyā
Anybody here who has worked on generics api view ?
Don't ask meta questions like: "Any user of $x here?" "Anyone used technology $y?" "Hello, I need help on $z!" Just ask directly! The better you are at explaining the problem, the more likely you are to get help. Asking smart questions
👑 Dharmzeey
Please which is better, 1. Extending the AbstractUser class to include other fields I want Or 2. To create another Class model which will point to the User class with a ForeignKey and then adding other fields to that new model
Sayidbek
Hello friends, I want my model show how many time ago question is asked, as YouTube shows in its comments, but what's wrong with it? class Question(models.Model): title = models.CharField(max_length=100) created_date = models.DateTimeField(default=datetime.now()) updated_date = models.DateTimeField(auto_now=True) asked_at = models.CharField(default=created_date - datetime.now())
Ali Hasan
I didn’t link a telegram account I used a python decorator 😑
Ali Hasan
Format like this 2022-05-14 16:18:00
Wait lemme type that again
Ali Hasan
Format like this 2022-05-14 16:18:00
I didn’t mean that , I meant how do you think it references each created date when you used: asked_at=…(created_date - datetime.now()) Do you think it will update the record in DB every single second ? This should be a dynamically calculated field , use the property decorator to define a method that will return what you need
Ali Hasan
So basically PROPERTY DECORATOR def asked_at(self): return self.created_date - datetime.now() And btw this equation is not true. You want to subtract the current time from the created time.
Ali Hasan
Ok, thanks
. Hope this gives you the place to look for your solution
Нефор
Hi
Нефор
advise courses on Django
Rohan
advise courses on Django
Read the pinned post
Anonymous
hi, I'm creating post by createAPIView in drf . After creating this thi fields reamining as I type. When I refresh the page it is creating the post again. What I have to do?
hydrozzen
Hey, sending media is not allowed in this group but I want to ask something via a screenshot actually it's 2 screenshot of a same page in browser One when I just double click on the page contactus.html And one when I give command python manage.py runserver
hydrozzen
The whole ui changes
hydrozzen
I want to know when i would deploy that page which UI will I get ,this time it's a fully working one that means it whenever someone press the submit button the information comes to me
Alek
Hi, could you please take a look at my question: https://stackoverflow.com/questions/72235840/how-can-i-add-ordering-for-manytomany-field How can I add ordering for ManyToMany field?
Ali Hasan
May I ask why my messages were deleted ?
WHOIS
Please help me if I add the insertion is done in the costumUser table and not in the customer table please help me it's urgent
WHOIS
Because you are creating an CostumUser object
I did not understand my friend be much more explicit please
Ali Hasan
I did not understand my friend be much more explicit please
Your question is why it is creating a CostumUser instead of a customer , I said because you are creating it using CostumUser model in your line of code : CostumUser.objects.create… Look at your code or perhaps you’re asking a different question maybe ?
Ali Hasan
no i want to do an insert in both tables customUser and client
So you mean you need to store same information in two tables (Models) ?
WHOIS
no look user.client.sexe=sexe.........
WHOIS
it's two insertion
ClassLamp
no i want to do an insert in both tables customUser and client
yes he want to insert the same data in two tables
Ali Hasan
Well you need to create the client object first and then give the client property as the client you create in your CostumUser object, i.e: x= Client.objects.create(….) then: user = CostumUser.objects.create(…., client=x)
Ali Hasan
Ali Hasan
Look, if you want to insert in two different models then create each one separately
ClassLamp
Then why did he say no … xD
he insert the client firstly and the costumerUser
Ali Hasan
he insert the client firstly and the costumerUser
Well yeah generally if A depends on B then B must be created first and then link it inside A
ClassLamp
ok i will try that thx
Try and see the res..
Роман
hello everyone. how do I add my page to the django admin panel?
OceanMan
hello everyone. how do I add my page to the django admin panel?
https://books.agiliq.com/projects/django-admin-cookbook/en/latest/
Роман
https://books.agiliq.com/projects/django-admin-cookbook/en/latest/
thanks. I hope I will find the answer to my question there
OceanMan
Welcome
Sunnat
the best resources and books were needed to study the django framework
Doragonsureiyā
the best resources and books were needed to study the django framework
Looking for Django tutorials? you can follow these three recommended ones: * Official documentation and tutorial * Tutorial from MDN * Tutorial from django-girls
Anonymous
Hi, I wanna learn Django. Can I start with the book "Django 3 by example" by Antonio Mele? Or it is not recommended for beginners?