Anonymous
It is blinking even now!
Nichita
And what's your doubt ?
I don't know how to Google it
Trials
I don't know how to Google it
register model django admin read only maybe 🤷‍♀️
Mirco
I don't know how to Google it
Django read only could be enough 😁
Anonymous
I am trying to execute the command Question.objects.get(pub_date__year=current_year) but I am getting an error. What would you advise?
Firdaus
Where can I find
I personally use Bulma CSS frameworks. Much easier to wrap my small brain around it Than bootstrap
Firdaus
Stopstopstop, for example I have user model I want to have two different views, one for editing user(this is implemented by default in admin panel) but another will be read only
Each view refers to 2 different modelform. For the read only view you use modelform with fields set as read only. I think the argument is read_only=True.
syedj
I have written 2 views one is login and second is home. In login i authenticate and login and return home page.
syedj
After login if i go to my login url again it should return back to home page if its authenticated
syedj
I have written if request.user.is_authenticated
syedj
In login
syedj
But its not redirecting me to home page
syedj
request.user.is_authenticated
syedj
Returns false
syedj
Second time
Firdaus
Settings | Django documentation | Django https://docs.djangoproject.com/en/2.1/ref/settings/
Firdaus
Check login_redirect_url in settings.py
syedj
I tried with @login_required(login_url='/')
syedj
Its working fine
Yusniel
Hello everyone. I'm working on a Django project with pipenv. In my project I have to use a previous installed module using python setup.py command. How to install the local installed module into my pipenv project?
Anonymous
if Post.objects.all() != None: return () Will it causes any issues ?
Дмитрий
if Post.objects.all() != None: return () Will it causes any issues ?
probably better to use Post.objects.count() or Post.objects.exists()
Prinart
I am trying to execute the command Question.objects.get(pub_date__year=current_year) but I am getting an error. What would you advise?
Use Question.objects.filter(pub_date__year=current_year) rather. Using the "get" means the results need to be only one object. So if it returns more than one object, it throws an error. But filter can handle more objects returns
Anonymous
@Prinart thank you! After coming home I am going to try it!
Mr. Achiever
Hello Team, Need help on intergrating Bootstrap 4 with Django Admin. I want to customize look and feel of the entire admin interface. Any suggestions???
Anjani
Any body know how to use django fcm?
Mr. Achiever
Thanks. I was planning to modify base.html or create a new html page by extending base.html.
Mr. Achiever
I'll have a look at django-grappelli
Mehul
how to create chatbot in django
Mehul
?
Vladimir
how to create chatbot in django
do not use django for chatbot, it is overhead
Anonymous
Is there any get_authentication method in drf like get_permission that can grant variable authentication classes
Anonymous
So i have a custome authentication class based of token authentication and is being used in various apps of my project. But in one modelviewset i dont want to invoke this for post calls only, in the same viewset i need this in get put and destroy requests but not in post
Mirco
mmm you have access to authentication_classes tuple
Premraj
What are the best practices for transferring data in development database for tables (which are only relevant to django models) to the same tables in production database ?
Premraj
Are there any django-specific ways ?
Fisseha
Can anyone give me django by example plz?
inchidi
Are there any django-specific ways ?
looks like fixtures is what you are looking for
syedj
Can we change django forms dynamically in ui
syedj
Like changing dropdown to text box on select
Anonymous
Can we change django forms dynamically in ui
You can use crispy to make it more stylish
Grigoriy
Hi, all. Does anybody know how to get model from ListSerializer in DRF?
inchidi
Hi, all. Does anybody know how to get model from ListSerializer in DRF?
maybe try explain what you trying to achieve to avoid xy problem?
Grigoriy
Being in to_representation_method I tried to add more information to field, including model_name (need it later). When stumbling upon a ModelSerializer I successfully could extract it from field.Meta.model._meta.model_name But for ListSerializer (as i discovered) this info is located in field.child.Meta.model._meta.model_name Managed to solve this problem by myself but thanks anyway
inchidi
am not sure but i think you can also use field.child.Meta.model.__name__
Premraj
syedj
use javascript for that
Is it possible to remove a drop down and replace it with textbox on selected a field
Ajay
Hi I have problem in URL path
Ajay
It's showing like path mismatch
007
How to provide download option to image in django ?
Mirco
How to provide download option to image in django ?
Views or template ? Explain better pls
007
Views or template ? Explain better pls
Suppose their is an image gallery which contains images which were uploaded by user. I want to provide download image option to each image in my html file
Gursi........
Study material or other to understand bs4 (beautifulsoup)
syedj
Django forms choice fields im trying to have on select event
syedj
It's failing
Lapanit ☃️
hi
Lapanit ☃️
came for drugs
syedj
It's failing
reciept=forms.ChoiceField(reciept_types, widget = forms.Select(attrs = {'onchange' : "myFunction();"}))
syedj
This is throwing error
syedj
My requirement is when i select a value a java script method should be invoked
syedj
Can anyone help
cj
My requirement is when i select a value a java script method should be invoked
write that in a JS file, not directly on the python code