Anonymous
If I had a student database and in that how can I check if the student name already exits
Shubham
Okaie guys
Shubham
I'll try it out
Shubham
I tried using admin datetime picker widget. But is gives me error 'DateField' object has no attribute 'is_hidden'
Shubham
Any idea about this??
Shubham
Ohh
Shubham
Wait I'll try that
Anonymous
Ok
Андрей
But i suppose, that it returns Child objects. Should I use my hack from patebin to get list of Parent objects? Or there are exist some another hack?
Shubham
坂田銀時
Ok so if i send 10k user to template it will gonna hit db whether i use it in template or not
A queryset only executes if you call terminal query like first(), last(), count() on it, or if you try to iterate over it or convert it to iterable. So it won't hit db until you do any of these things.
坂田銀時
see i send 10k user to template now in template i will do For user in users: If user.id = x: {{x}}
Is users the queryset? Since you're trying to iterate over it, it would run query and load all 10k user objects in server memory.
坂田銀時
It would be better to do {{ users.filter(id=x).first() }}
坂田銀時
No
坂田銀時
Try it yourself in shell. Watch SQL logs.
#
hi guess, i wana develop Mobile app with React Native and django, so could u tell me some tips like best blogpost, books and etc for django and react?
#
Google it Habesha
that is what i am doing, but the question is if there any best resource u experience to share me
Ratana
How To Setup And Run An Existing Django Project On Windows?
Rσуαℓ geeк
How To Setup And Run An Existing Django Project On Windows?
Learn how to install and run Django in the first place the steps are the same
Ratana
Create a virtual environment and install dependencies. mkvirtualenv new_project pip install -r requirements.txt Duplicate new_project/new_project/local_settings_example.py and save as local_settings.py. Enter your database settings in local_settings.py. Initialize your database. python ./manage.py syncdb python ./manage.py migrate If your app has a custom user model, you'll need to create a new superuser for the admin. python ./manage.py createsuperuser Run the development server to verify everything is working. python ./manage.py runserver
Ratana
This is the step I got, but still errror
José Daniel
Reminder, Python 2 support will expire next January.
Ratana
syncdb? are you following some old old old tutorial?
I don’t know. Do you have a latest one ?
Doragonsureiyā
I don’t know. Do you have a latest one ?
Looking for Django tutorials? you can follow these three recommended ones: * Official documentation and tutorial * Tutorial from MDN * Tutorial from django-girls
Yash
good bot
6Orion
I don’t know. Do you have a latest one ?
YouTube - freeCodeCamp - Django 2.2 complete video
6Orion
4.5 hs, best source I had to make a complete blog site with all necessary elements, progression is easy and logical
Anonymous
How can I get the logged in user ? request.user?
坂田銀時
Yes
Harsh
Hi guys can you tell me how can I setup my Django project on AWS ec2 instance and run it
cj
Hi guys can you tell me how can I setup my Django project on AWS ec2 instance and run it
Harshal. Here you have a useful link: https://duckduckgo.com/?q=Hi+guys+can+you+tell+me+how+can+I+setup+my+Django+project+on+AWS+ec2+instance+and+run+it
Rσуαℓ geeк
You could use a Boolean field to track if a user is first login
Anonymous
Who comes from America?
Anonymous
How to run a python script on button click? Can we use the on click =?
Shubham
Hello all, I have some doubt in my Django project. I have some staff users and a product table. I want something in Django admin that the user when open the products table can see only his added products. How can we do this type of thing in Django.
Erik
Hello all, I have some doubt in my Django project. I have some staff users and a product table. I want something in Django admin that the user when open the products table can see only his added products. How can we do this type of thing in Django.
Into Product model you need to add new field related to User model. And while the staff create a new product entry a current staff object set to value of the new field. After that you can add filter for show only his added products .
Anonymous
user_products = Products.objects.get(user=user)
Anonymous
user_products = Products.objects.filter(user=user)
DCT
I want to study django
Sultonbek Ikromov
Dcruz
😂
Ghorz
LOGIN_REDIRECT_URL = "URL HERE"
Shubham
user_products = Products.objects.filter(user=user)
Where should I write this filter query if I want to show the result in Django admin
Anonymous
admin.py under your ClassAdmin
Maksim
i can't find exception 404 if page doesn't exists Try: redirect.. Except (I want to handle 404): redirect ..
Mirco
Yes
What kind of script you wanna run ?
Anonymous
What kind of script you wanna run ?
It's a test script that generates records into the database
芒果味雪糕
现在可以用什么替代xadmin
The Summer
Guys i have one problem
The Summer
Here is pastebin link https://pastebin.com/PbDgJEkE
Almaz
Hello everyone! Is there some usefull articles, how to work with money operations and store money properly in Django?
The Summer
I want to send questions whose category is in the user's chosen category' But i got some error
Anonymous
Just reverse to needed views /)
You make it sound simple 😁 😁 any examples on it? I couldn't get it to work yet
Master
any example please?
https://www.pythoncircle.com/post/564/displaying-custom-404-error-page-not-found-page-in-django-20/
Erik
You make it sound simple 😁 😁 any examples on it? I couldn't get it to work yet
https://stackoverflow.com/questions/48438575/call-django-on-html-button-click/48438962 http://www.learningaboutelectronics.com/Articles/How-to-check-if-the-submit-button-is-clicked-with-Python-in-Django.php
Erik
Is DecimalField is enough to work with money
Yes. With use Decimal field on production.