M
i need only 3days ago not 3days and 4hours ago
M
When its hours equal to 24h i need only days
M
So the result will be 1 day ago without hours
Д
I think you'll have to write your own filter for this
Д
https://docs.djangoproject.com/en/4.0/howto/custom-template-tags/
M
So i cant edit the timesince ok i will see this doc
Д
it shouldn't be a huge problem to write your own
M
Ok i will thank you so much 🙏🏻
Д
good luck.
Neo
https://stackoverflow.com/questions/24818768/django-built-in-timesince-filter-to-show-only-days
M
does that do what you need? ^
Yes like this one but with hours if hours < 24 and after with days only yes thank you maybe thats will be work
Д
Neo
subtracting the datetime you have from current datetime should result in a timedelta object iirc from which you can simply do an if else
Neo
and of course that in combination with the stackoverflow answer should give you what you need
Д
one kinda 'nifty' option would be if you could "divmod" dates - get the quotient and the fraction
Neo
https://gist.github.com/DarkRedman/54fa2a7b34ccc58a70c31ad1af88d29e
This might also help
M
Neo
Д
don't worry. it's not relevant. divmod is just a mathematical operation that gives you the 'divisor' and 'remainder' (it's also a python function)
M
Neo
And hey you can always make it a package for the rest of us
Д
I could make many packages for you ;)
Д
but better make PRs to existing ones
J
I am having issues with my tasks app
Each time I try to open two files in my tasks folder inside my templates, the index file runs perfectly but the add. html file which is the second file in the tasks folder gives me error 404
I check my code very well and nothing is wrong with it
Please help me out
༆𖤍ཽ🇻 G⃖r༙e༙y༙h༙a༙t༙⚚×͡×
TIME_FORMAT filter shows an error why??
Doragonsureiyā
R@kesh
how to set this error in atom ???
R@kesh
Traceback (most recent call last):
File "C:\Users\Rakesh\.atom\packages\autocomplete-python\lib\completion.py", line 8, in <module>
Charly
J
Ok thanks
But it is not static because the code does not have any css styling for now
I was practicing form with html on django
I already have my index html running perfectly from on my template
But I think I am having difficulty trying to add another html file inside my templates folder called add. Html
I checked my code starting from my views. py down to urls. py it was ok
But then I am error 404
Please help me
J
Charly
Doragonsureiyā
I do not know if you can help me out on that sir 👆🏼?
Don't tag people randomly, even if they seem knowledgeable. Most of the time, the person you tagged doesn't even know about the topic you just brought up. If people want to help you, they will - just be patient.
J
Strauss21
Hello I have a question ?
what is the better way to deploy a django website as a beginner and how much it costs
Anonymous
I want to add multiselect option
But don't how to do it in Django rest framework,
So if anybody has idea of multiselect or multichoice option in DRF
Then plz tell me
Enes
Lucky
I want to get the data from username is there any code for that
Lucky
In django restframework
Lucky
In crud operation
Strauss21
+
i saw that digital océan have hosting for 10 usd /month is it a good option
ꪉꫝꪖꪹᦋꪖꪜ
Can anyone pls tell me how to reduce sso login time?
ꪉꫝꪖꪹᦋꪖꪜ
It's taking much time to redirect home page, how can i reduce it?
Enes
but not used for production..it is free
Strauss21
Enes
Claudia
hello I have a question how can I hide a file type input when I am working with {% for field a formx %}
Mohammed
👋hallo
Mohammed
Good morning
Mohammed
How are you?
Ali
ImportError: cannot import name 'Httpresponse' from 'django.http'
How can I solve this problem?
Anonymous
ky
i need to import csv file in model
ky
i try but not working
:x-re
debian or ubuntu
for deploy django ?
ky
ubuntu
:x-re
version lts?
Лупеко И. В.
I’ve been hardly learning Py for a year.
I wanna learn how to work with Django.
Advise a serious and fully book please
Alexey
Ali
Shadow
Лупеко И. В.
Udemy?
What’s this? Is it an author?
Shadow
What’s this? Is it an author?
https://www.udemy.com/course/python-django-web-development-to-do-app/?utm_source=adwords&utm_medium=udemyads&utm_campaign=LongTail_la.EN_cc.ROW&utm_content=deal4584&utm_term=_._ag_77879424134_._ad_535397245863_._kw__._de_m_._dm__._pl__._ti_dsa-1007766171312_._li_2702_._pd__._&matchtype=&gbraid=0AAAAADROdO1DVQagzpbH5WlaQ7o5J63CO&gclid=EAIaIQobChMIobDt-cvK9gIVyZ1LBR3Ftw3xEAAYAiAAEgLHTfD_BwE
Лупеко И. В.
Oh, I got it
Лупеко И. В.
But I need a book exactly, not courses)
Shadow
Is a website, there is a lot of good stuff there and step by step guide but not all the course is free
Shadow
Лупеко И. В.
Perhaps. But for me, it’s better to read and handle book
Shadow
Ic
Shadow
Perhaps. But for me, it’s better to read and handle book
https://www.amazon.sg/Web-Development-Django-applications-Python-based/dp/1839212500/ref=asc_df_1839212500/?tag=sgsmrtphshopg-22&linkCode=df0&hvadid=404765462869&hvpos=&hvnetw=g&hvrand=3813743537247213578&hvpone=&hvptwo=&hvqmt=&hvdev=m&hvdvcmdl=&hvlocint=&hvlocphy=2702&hvtargid=pla-1202063357020&psc=1
Shadow
One of my friend have this book and is thick, a lot good content inside
Raj
Лупеко И. В.