Mirco
007
Ok
Turtle_In_Hurry
Turtle_In_Hurry
Hey people i need some help
So I've seen some people are using whole jwt token instead of only signature part to send with verification url
Turtle_In_Hurry
Is it correct way
inchidi
prolly its just a token not a JSON Web Token. because if its JWT, big chance it will be expired when user using it. if its not expired because it have long expiration delta, then yes its not proper way
007
How change look of ModelForm using html and css
Mirco
007
Actually my form is in
{{ form.as_p }} format.
I want to make it more attractive
007
Adding some css effect
Mirco
you have access to your fields via form
so for example {{ form.name }} or {{ form.name.label_tag }} and so on
this link could be useful for your learning
007
got it... thank you😊
Mirco
yw :)
Anonymous
hello, iam beginner
Anonymous
DATABASES = {
'default': {
'ENGINE': 'sql_server.pyodbc',
'NAME': '3D',
'USER': 'sa',
'PASSWORD': 'xxx',
'HOST': '3D-LOCAL\SQLEXPRESS',
'PORT': '1433',
'OPTIONS': {
'driver': 'ODBC Driver 13 for SQL Server',
},
},
}
This configuration doesnt work
Anonymous
whats wrong?
Petr
Mirco
Anonymous
http://dpaste.com/1ZMVPCE
Mirco
Is your database engine running ?
Rino
hi guys, i need some help about serializer and models,
https://gist.github.com/kunci115/46f2f46d28665c5bbf0ab0cba865aab9
https://gist.github.com/kunci115/87ac3aeac18ead485b005bca35edcaf3
those 2 link is my models and serializer, and bellow the views
https://gist.github.com/kunci115/3198cda9358781cd993d4acba2ca1424
When i put others field else person_name is don't have any problem, trouble come when i put the person.name, anyone know what is my fault and what i have to change?
the error said "cannot assign "{'name': 'hehe'}": "Profile.owner" must be a "Person" instance." , thanks
Mirco
Rino
https://gist.github.com/kunci115/fea61da348f4359da7f1d8ec830849d0
Rino
that is my settings
Mirco
mmm you can use pdb to understand better what kind of instance is Profile.owner at that moment
Rino
Ok
Isaías
Hi!
Isaías
How used ajax in django template?
Isaías
Ex: <a href="{% url 'enquete-delete' ${item.id} %}">
Isaías
Error: TemplateSyntaxError(Could not parse the remainder: '${item.id}' from '${item.id}')
Isaías
Help!
Mirco
Isaías
syntax of ajax
Isaías
JS
Mirco
Not in a href tag
Mirco
Have you already read about using AJAX with Django ?
Isaías
No.
Mirco
No.
Do it, try to understand, refactor your code and when you are stuck ask again 💪💪
Isaías
OK
Mirco
OK
That's a way to learn new stuff imho 😁
Isaías
Yes
Isaías
😀
Isaías
resolved! 😉
Turtle_In_Hurry
Turtle_In_Hurry
I've Don't that invitational part
Turtle_In_Hurry
Now thinkin how to handle that invitational like if someone hit on that link
Mirco
Anders (izzno / gooood) 🇳🇴
@c0x6A ,THIS! Fast and performant Django / JS combo :)
https://gist.github.com/izznogooood/207271d5b3445c508f553a0003feab13
Thanks for pointing me in the right direction.
Mirco
Anders (izzno / gooood) 🇳🇴
I can skip the API and "auth" completely. Perfect for small/medium apps!
Mirco
That's the classic way, using Django session based auth 😁
Anders (izzno / gooood) 🇳🇴
Yes, but this way of using django with fetch / form / CRUD was / is not documented anywere... Took me half a day to figure this out hehe.
Mirco
It doesn't look so different from $.ajax way ( I mean the code flow, not implementation )
Anyway if u use fetch, you could use async/await 😁
And IE users won't love ya 😂
Anders (izzno / gooood) 🇳🇴
Mirco
Anders (izzno / gooood) 🇳🇴
The fetch/ajax is not important, the CRSF token and way to communicate the user session and skip the API part is the thing I love.
Anders (izzno / gooood) 🇳🇴
Just let django handle Auth, login etc... Emails... all that.
Mirco
Anders (izzno / gooood) 🇳🇴
Not how to get the token from your cockies etc. How to handle forms (not created in Django etc...)
Anders (izzno / gooood) 🇳🇴
Took alot of experimenting.
Anders (izzno / gooood) 🇳🇴
(only because i did not know the request.POST object...)
Mirco
Anders (izzno / gooood) 🇳🇴
Me to, parts and pieces, but they focus on sending json objects. not forms. it might have been easier, but i got stuck on forms
Mirco
Anders (izzno / gooood) 🇳🇴
Ashik
Can we validate user input using pycharm ide
Mirco
cj
cj
https://google.com or https://duckduckgo.com
Guillermo
https://docs.djangoproject.com/en/dev/intro/tutorial01/
Anders (izzno / gooood) 🇳🇴
This is a complete toturial getting you up to speed fast.
https://developer.mozilla.org/en-US/docs/Learn/Server-side/Django/Tutorial_local_library_website
cj
define: «Shango»
Anders (izzno / gooood) 🇳🇴
Anders (izzno / gooood) 🇳🇴
https://www.youtube.com/watch?v=UmljXZIypDc&list=PL-osiE80TeTtoQCKZ03TU5fNfx2UY6U4p
Its does not gett better than this... If you are new at python, check out his python tutorials as well.
cj
read the official docs 🙂
Shubhanshu
How to create Rest Api in Django
Guillermo
Shubhanshu