Mirco
cutout
Hi guys my python course completed can I join Django or not
Artyom
I think u are welc!
Artyom
Hi gays. There is some geodjango. Did somebody face with this error: geom: ["Invalid format: string or unicode input unrecognized as GeoJSON, WKT EWKT or HEXEWKB."] ???
Michail
I have in my view a list of items. And I want them in random order every time. What's good way to achieve that? Not the DB-intensive .order_by('?') . preferably in view code
SatyendraN
Can we put condition in form field when we select specific choice other field become mandatory ? I have tried clean method in form but unable get any luck.
🏳️‍🌈Robby [ Private Message = Spam]
What is the end goal?
SatyendraN
I just want mandatory field optional by choice of specific field
SatyendraN
If I have two choice 1)open 2)close When someone select close all form field should be required
🏳️‍🌈Robby [ Private Message = Spam]
If I have two choice 1)open 2)close When someone select close all form field should be required
Use javascript and validate accordingly serverside as well. NEVER trust solely javascript to validate Remember: browsers aren't the only way to submit your form :)
SatyendraN
How can we use none in date field in django form?
SatyendraN
I want to fill date whenever it is require either want user to fill none
Doug
by default the DateField is set to date.today
Doug
you should be able to set it as None if you allow it. It's technically just a text field with special powers
Doug
https://docs.djangoproject.com/en/2.1/ref/models/fields/#datefield
Doug
so try setting default=None on the model field
Doug
might have to also set blank=True
inchidi
thanks
🏳️‍🌈Robby [ Private Message = Spam]
Also why is this not under the python network?
🏳️‍🌈Robby [ Private Message = Spam]
I thought it was — which would likely mean I uh — couldn't be here
Vaibhav
can we call function based view from button click (template)?
Vaibhav
how?
Mirco
how?
I strongly encourage you to study better django basics Anyway into your form put the url where you call the function based view into action attribute
Alexander
how?
add js action on button click and send fetch request to your url
Vaibhav
i am basically making auth page...where i want to log the user out by clicking logout button...i dont have separate page for logout...@micro your method doesnt work..
Vaibhav
Thanks @pyflare for your Help !
Anders (izzno / gooood) 🇳🇴
Anders (izzno / gooood) 🇳🇴
Looks good 😁 congratz
Thank you!, This is a sideproject but really gets the Django / JS combination through... Including the auth handling by django.
Anders (izzno / gooood) 🇳🇴
Django as allways is a "rocket" start ;)
Anders (izzno / gooood) 🇳🇴
Off-topic: I am amazed by the anonymity of Django in the JS community... Imagine the time spent.... (:D)
Anders (izzno / gooood) 🇳🇴
I Simply dont get it...
Mirco
I Simply dont get it...
Me neither ,😂
Anders (izzno / gooood) 🇳🇴
I really dont get why more people use Django as an auth / API platform... You save so much time / security issues...
Anders (izzno / gooood) 🇳🇴
Am I on a side track or do people really not see the benifits of both Django/Node/(someJSframework)
Anders (izzno / gooood) 🇳🇴
Maybe the second one I suppose
Sadly I think that's true.
..
Hi, guys. Need your help. Do you know how to construct a tree based database on django rest framework. I tried to use usual model-foreignkey way, but it turned out it's not correct. I found there are some libraries - django-tree, mptt, anyone have used them?
Sagar
if conn.is_connected(): curs.close() conn.close() Error: module 'mysql.connector' has no attribute 'is_connected' It doesn't have?
merc1er
Ah no, the module doesn't have, it should be the MySQLConnection object
merc1er
How do you init conn?
Naveen
Guys i want to implement matplotlib graphs in django. I have app ..which will take the data from user input ..and now i want to display the graph if that data
Sagar
How do you init conn?
conn = mysql.connector.connect(params), this is what u asked for?
Naveen
Of*
merc1er
Can you show your code?
Sagar
Can you show your code?
Sending a ss in pm should be good? Bcs tg is not installed in pc
Vaibhav
@pyflare I was right ..just i name my view logout which get conflict with actual logout function provided by django😂
Anonymous
Hello! Good Saturday!
Anonymous
Which is the best structure for my django project?
Anonymous
https://django-project-skeleton.readthedocs.io/en/latest/structure.html#apps https://django-best-practices.readthedocs.io/en/latest/projects.html#handling-urlconfs-for-multiple-environments https://stackoverflow.com/questions/22841764/best-practice-for-django-project-working-directory-structure https://www.revsys.com/tidbits/recommended-django-project-layout/
Anonymous
Someone has some other best practice to structure my project?
Mirco
Someone has some other best practice to structure my project?
You can follow the one explained into Two scoops of Django book
Naveen
You can use chart js insted
I don't know js much
Mirco
In which Django book?
2 scoops of django
Anonymous
2 scoops of django
It looks very interesting: https://www.twoscoopspress.com/products/two-scoops-of-django-1-11
Anonymous
2 scoops of django
Thanks Mirco!
Mirco
Thanks Mirco!
Yw 😊
Shreehari
can i know why im getting this error: https://del.dog/amipuxehuz.sql
Shreehari
same error
Shreehari
irrespective of the name
Mirco
same error
What about if u run manage.py check ?