Mirco
what is the best way to publish a site? How do you do it?
It depends on your needs You can use the free tier of a PaaS or use your own VPS
tushar
if pass two or more arguments in
tushar
if pass two or more arguments in
value.objects.exclude()
John
What is django CMS. Just a minutes ago I find it's is its good for use when u only need django as a backend service
Mayuri
Please can anyone tell me how to create calendar in django ...I get start date and date From frontend
Doragonsureiyā
Please can anyone tell me how to create calendar in django ...I get start date and date From frontend
What have you tried to do so far to solve that issue? Show your code and explain where and why you're stuck on solving your issue. Read rule 5️⃣ to learn how to show your code
Vivek
Can anyone tell me the difference between modelform and form
Mayuri
In response I want dictionary like { 2021:{ jan: { 1 jan : plan date 2 jan: unplanned date }, Feb: {1feb: planned holiday 6 feb: unplanned holiday }....... Dec: {12 Dec: Planned holiday, 26 Dec: unplanned holiday } } }
D
Is it necessary to run collectstatic command ?
Agent Q
Is it necessary to run collectstatic command ?
https://docs.djangoproject.com/en/3.2/ref/contrib/staticfiles/#django-admin-collectstatic
Ashutosh
Can anyone tell me the difference between modelform and form
Model form inherits field name and validation, from model directly. And model form also has save() function by default on order to create, update entry model.
Ashutosh
Is it necessary to run collectstatic command ?
In case your using django server to serve static content: Not really, but it's good practice to put all the static files in one directory and serve from there. In case, you use nginx or CDN: You always want to collect files in your hosted dir or CDN.
Random
When i use just foreign key in a models class, no data gets generated for that model , why ?
Ashutosh
#everyone, need a vote Just think if you can create an django project complete frontend-backend using simple UI.
.....
How to get data from api?
.....
How to get data from api?
Anyone please send me sample code
Mirco
Anyone please send me sample code
import requests response = requests.get("your_url") example of a simple GET
Ray of Hope
How can i integrate a chatbot in django ? Which is the best and easiest method , any suggestions guys
Anonymous
How can i integrate a chatbot in django ? Which is the best and easiest method , any suggestions guys
Get the message generator(chatbot) and in the create serializer(if you created 2 or more serializers to handle get and post differently), in that serializer you create the "reply" field with the value that the chatbot created(you create it as ModelName.objects.create(**validated_data, reply=chatbot_reply) -> this is created in the create method of the write serializer. If you have any question please tell me. I just created one today and I can send you the example
Anonymous
Sorry if I am not very clear( I am not that good with words)
Acs solutions
<a href= 'home' roll_no=3></a> def home(request): b=request.POST['roll_no'] it is not working can anyone please tell how to pass data from href link to view function
Anonymous
Can you explain the context please
Acs solutions
How to pass data from html href link to django view function
Anonymous
Are you using django or django rest and developing in html
Acs solutions
django only
Anonymous
You need to create a form and give names to input fields inside it
Acs solutions
No I came to a situation of giving that input by not creating form and send through href link, please help
Anonymous
https://stackoverflow.com/questions/62273606/how-to-write-a-post-method-to-an-a-tag-in-django
Anonymous
As Dhileepkumar ai suggest to use Django Rest Framework and use any other javascript libraries to develop your project
Anonymous
It will be way easier
Droll55
Hello! I need some help. I am having registration datetime(optional) and start datetime. I need to find a way, how to compare these two field with the current datetime. Here is my code: https://dpaste.org/GyO3. It fails if registration datetime wasn't set. Can someone help me to understand, how can i fix it ?
Devo
https://www.educative.io/edpresso/how-to-convert-a-string-to-a-date-in-python
Droll55
Try to convert those fields to datetime format
My mistake, should paste these fields too, here is update version: https://dpaste.org/Ymxi
Droll55
It works fine, if user set up registration date, so i dont think this is format problem
Devo
It works fine, if user set up registration date, so i dont think this is format problem
Yes it's not format error .. since it is empty while user didn't setup . Try to put default while or add an condition before that comparison statements.. like if not self.registration_start is null : Then compare kind of
Random
Validation erros shows up in debug page, how can i show validation errors on to html templates
Random
?
Anonymous
had to cta😅, does anyone know a well made tutorial on user authentication with react, Django and REST framework?
🏁 🏁 🏁
ValueError: The view project.views.page didn't return an HttpResponse object. It returned None instead.
âshîsh
ValueError: The view project.views.page didn't return an HttpResponse object. It returned None instead.
You should return an Http response after your code execution in views.py return HttpResponse ("success")
🏁 🏁 🏁
View not return
Hah, thanks
🏁 🏁 🏁
it was just render
Random
Random
I am using Createview whre i raise validation error under some conditions under form_valid()
Random
And facing error on deubg page of validation error for the condition i set
Random
I expect to validation error to be shown on html template instad
Michael ✨
I have a question, how can I get the value of my context_processor in a view? So I know it can be done in the template but I don't know how to get it in a view
Michael ✨
this returns my context return {'total_amount': total}
Michael ✨
This mi complete context:
Michael ✨
https://pastebin.com/BjdXq7fw
Mirco
I expect to validation error to be shown on html template instad
You have form.errors and for specific field
Random
You have form.errors and for specific field
I have mentioned form.errors in template
sainath
Someone please explain why django app is deployed in Linux server and what is the use of it... Is all django app must to be deployed in Linux server?
Sumit
Someone please explain why django app is deployed in Linux server and what is the use of it... Is all django app must to be deployed in Linux server?
No, you can deploy it on heroku or python everywhere or any windows server. Noone is going to stop you.
Sumit
Can anyone tell me how to keep track of which user has opened profile of whom user like LinkedIn in Django and to give notification too like that?
Anonymous
Hey people I am new in Django and I have doubt
Anonymous
How can I delete an image when I delete an object with instance.delete() or Model.objects.delete()
Anonymous
When I do it the image doesnt delete from my computer
Agent Q
When I do it the image doesnt delete from my computer
Did you mean delete image from database?
Anonymous
If actual file, os.remove()
Should I override the delete method ?
Anonymous
Saw a module called django_cleanup that solve my problem but I have my images in a folder with the image name (product_name/image.jpg) and the package delete the image but no the folder
Anonymous
Some here that knows how to work with django_cleanup?
Random
How to add data to database without form
Naresh
A=student.objects.filter(class=parameters [0]['class'], values ('details')[0]) When I try this query it shows Positional arguments follows keyword argument