William
Anyone here to help me on a simple question. I need to add multiple field choices in django.models for charfield for subjects. eg output : subjects = physics, chemistry, maths how can i do it.. please help me.
First, create choices and by using choices arg you can pass the subject_choice variable in it. Check this https://docs.djangoproject.com/en/3.2/ref/models/fields/#choices
игорь/igor
Any sample code or something like that to refer.
https://stackoverflow.com/questions/1091372/getting-the-clients-time-zone-and-offset-in-javascript
Khasanboy
HI guys hwo knwo to use celery in ubuntu server
Khasanboy
I can't run my celery app as systemd service
Khasanboy
yes
Mohammad Javad
i have a this kind of problem
You were using a name in your path "name" variable that you didn't define it
Parth
Can anyone knows about how to schedule a method for every 1 hours
Parth
Celery
That's package work on windows system
игорь/igor
Parth
Ok
Parth
Thanks I try
Enigma
hi every one i deleted every static files(CSS JS Fonts) in my assets folder and my static root folder . but it works fine. i want to change them but it does not work what should i do?
Firdavs
I have csrf_token in my form but the error is " CSRF token missing or incorrect. "
sheikh
pls help me
How you are sending token?
Enigma
i want to put a choice filed in my forms , aslo i want to gice attrs for it , what input should i use for ir?
игорь/igor
i want to put a choice filed in my forms , aslo i want to gice attrs for it , what input should i use for ir?
People, do you even read documentation before asking? https://docs.djangoproject.com/en/3.2/ref/forms/fields/#choicefield
игорь/igor
I have sent you the link
Enigma
i could google this before , there is no help for giving attr for choice fileds that can help
игорь/igor
i could google this before , there is no help for giving attr for choice fileds that can help
Html attrs are done with widgets, for choice field a "select" widget is usually used
Enigma
Html attrs are done with widgets, for choice field a "select" widget is usually used
tnx for your help i found it now , but it doesnt look like a dropdown for choices...
Enigma
i mean the arrow
Enigma
its solved too :) tnx for your time
игорь/igor
No problem
Firdavs
How you are sending token?
simple, csrf_token as
игорь/igor
simple, csrf_token as
Use {% csrf_token %} just after the form tag
Anonymous
Firdavs
in form tag
but dont work
Doragonsureiyā
but dont work
Please provide a full explanation including all the details that you consider relevant. Your statement is too broad and there is no clear way to answer you, you have to explain: - what you're doing - what you're expecting - what you're using - where you're running the script - what Python version you're using - what packages and their versions you're using - and the most important thing: show the code YOU wrote (read rule 5️⃣ for that) and more details, that way your chances to get help will increase
HRITIK
How can I change the classes of fields in template using django view functions
sheikh
but dont work
How you are sending in backend by ajax or any other way?
Doragonsureiyā
How can I change the classes of fields in template using django view functions
Please provide a full explanation including all the details that you consider relevant. Your statement is too broad and there is no clear way to answer you, you have to explain: - what you're doing - what you're expecting - what you're using - where you're running the script - what Python version you're using - what packages and their versions you're using - and the most important thing: show the code YOU wrote (read rule 5️⃣ for that) and more details, that way your chances to get help will increase
Anonymous
def activate(request, uidb64 ,token): print(token) try: uid = urlsafe_base64_decode(uidb64).decode() user = Account._default_manager.get(username = uid) except(TypeError,ValueError,OverflowError,Account.DoesNotExist): user = None print(uid) print('c') print(user) if user is not None: if default_token_generator.check_token(user, token): user.is_active = True user.email = 'gnai' user.save() print(user) print('thosi') print(user.email) return render(request , 'core/base.html') else: print(',a') Token is not getting verify It is printing ,a
Anonymous
Can I check the token value after decoding it So that I can check it that does it meet with user
Anonymous
Internal Server Error: /activate/amphc2hhbjUwNUBnbWFpbC5jb20/ar0wnf-c3c33d13abc52ba80ccf4ffeea7c47d1 I am getting this
N3CRO
Guys i have a search bar function in my django app, i am having problem for making query on foreign key
N3CRO
Dow do we do that in search bar function?
N3CRO
How*
N3CRO
Also i want to show videos on screen upto 6 videos only then after i want a next button which can show other next 6 videos
N3CRO
How can we make such things possible does anyone knows?
Enigma
hey everyone im trying to add DateTimeFiled into my forms but in my page it shows like a simple text input , anyone knows what should i do?
Anonymous
hey everyone im trying to add DateTimeFiled into my forms but in my page it shows like a simple text input , anyone knows what should i do?
I've a good feeling the validator will start crying about how whatever you send through that form will be an invalid DateTime
Anonymous
How to access django project outside public url Django + nginx + suse Share some ref guide Uwsgi issue
N3CRO
Yes it possible
Could you please help me with creating that?😅
N3CRO
Also i need to know how do i make query on foreign key relationship filed in filter function for search bar
Enigma
https://stackoverflow.com/questions/68693455/datefield-in-django-forms-shows-like-simple-text-input
Aman
Kindly Suggest me a proper re_path to serve .js static files only.
Enigma
did you do as allexiusw said?
No. as I mentioned I don't want to use type "Date" in my code , because I'm trying to use Jalali Calendar and it dose not work on it. i guess the problem is form HTML...
Optimus
you need to add widget attribute type date
if using other date package then mention package class name and initialize
Sherlock
Hi, do i have to manage various sequrity related to web app or django manage automatically all kind of sequrity ?
игорь/igor
Hi, do i have to manage various sequrity related to web app or django manage automatically all kind of sequrity ?
Security, not "sequrity". Instagram uses Django, and several other big sites, does it tell you anything?
Anonymous
Please allow sending media in this group @admins
Doragonsureiyā
Please allow sending media in this group @admins
Rule 5️⃣: To share code or error tracebacks, use an online pasting service like: - https://del.dog - https://dpaste.org - https://linkode.org - https://hastebin.com - https://bin.kv2.dev If you posted a wall of text, go back and delete it.
Maxim
PM me
Enigma
I recommend using the advice of allexiusw
I mentioned , date type is not why im searching for
Enigma
you need to add widget attribute type date
i did date = forms.DateField(widget=forms.DateInput(attrs={'class': 'form-control'}))
Anonymous
PM me
PM ??