🌀
https://dpaste.org/X27j
Jerome
Q object has no attribute 'order_by'
you need to order_by with the queryset not Q
Sarthak
you need to order_by with the queryset not Q
I didn't get it, you mean to say instead of Q I have to write query_set ?
🌀
Parse the value of rate and qty to int before multiplication
I'm getting the result for 1st row...but after 1st row not getting any result
(⌐■-■)
You need to run a loop in html using the django Jinja syntax
Manik
Hi everyone Pleasw help After login in django admin how to redirect to another page
😒😒
Use return redirect('viewname')
Import redirect from django.shortcuts
Manik
Use return redirect('viewname')
I am using django in built admin authentocation after authentication i have to redirect to another page
Manik
I write this in my project url
😒😒
Or are you trying to redirect the django admin login to a different page?
Manik
Yes yes
Vikash
Hi everyone Pleasw help After login in django admin how to redirect to another page
After login django login view automatically redirect to the profile page
😒😒
Yes yes
Oh I haven't tried this before But I think I have some resources Let me check on that first
Vikash
So you need yo login_redirect_url= name of the url path
Vikash
In setting.Py file
Manik
Manik
But in setting where should i write this
Vikash
At the last
Vikash
LOGIN_REDIRECT_URL = "name of the path url "
Manik
Ok i will try thnx fr ur hlp
Vikash
Yea try it
Manik
Sir it's not working
Vikash
Share your url or views ss
Manik
Yes
😒😒
Yes
https://docs.djangoproject.com/en/4.0/ref/settings/#login-redirect-url
Д
protip: if you can avoid it, don't try to access the Django DB from other ORMs ... this was not worth it
Shazeb
if anyone use tailwind with django please help me
Doragonsureiyā
if anyone use tailwind with django please help me
Don't ask meta questions like: "Any user of $x here?" "Anyone used technology $y?" "Hello, I need help on $z!" Just ask directly! The better you are at explaining the problem, the more likely you are to get help. Asking smart questions
Rajat
Any suggestions for library for indian phone number as user ?
Bought
Hi everyone, who knows how to make last_activity for user
Somesh
I am using MySQL proxy server address to access database instead of direct access, once I added all necessary connection in settings.py it's showing this error. Where I did mistake? Anybody can help? showing Error Django.db.utils.OperationalError: (1115, " Unknown character set: "utf8mb3'")
Somesh
Hi everyone, who knows how to make last_activity for user
I think django have built in last activity feild in user. I think u have make use of that.. check django documentation
Fredy
Hello group... How they do for api versions... Case: a model with 2 attributes is used in version 1 in version 2 it is expected to add 2 attributes... How do you do this process?
💞 🌺 Flower 🌺 💞
AttributeError at / 'NoneType' object has no attribute 'lower'
ken
classA: # .. def __str(self) return self.name class B: # ... b_name = foreign key to class A how can instance of class b access the str method of class A
Anonymous
guys, when exactly should I do the following commands??: makemigrations migrate
Harry gorilla
I'd use the library python-dotenv since it knows how to load from files too (and it loads by default from .env)
https://stackoverflow.com/questions/41546883/what-is-the-use-of-python-dotenv#41547163 Like this?
cj
guys, when exactly should I do the following commands??: makemigrations migrate
here there's the answer you want: https://docs.djangoproject.com/en/4.0/topics/migrations/
Bought
I think django have built in last activity feild in user. I think u have make use of that.. check django documentation
It's a last_login field, so, should i use it? How can i find out if user is online...
Somesh
It's a last_login field, so, should i use it? How can i find out if user is online...
U can make use of last login field it's have information about when user Last time logged in..
Д
So i don't use .gitignore when i use python-dotenv?
.gitignore has to do with git. The dotenv is meant to read from your own files, like .env
Д
So i'll put .env file in my .gitignore?
That's a separate question
Д
So i'll put .env file in my .gitignore?
You can put some minimal example file of the .env into Git and then use .env.dev or .env.local to keep the passwords etc. out. Those files need to be then .gitignored
Harry gorilla
I was trying to not expose my secrete key in public to github
cj
I was trying to not expose my secrete key in public to github
just don't push them ¯\_(ツ)_/¯ as you were told, put the files in .gitignore
Harry gorilla
Then what's the importance of using python-dotenv?
cj
Then what's the importance of using python-dotenv?
to have the values you don't want to expose, in an external file —commonly .env— to load environment variables ¯\_(ツ)_/¯
Д
Then what's the importance of using python-dotenv?
The point is that python-dotenv is a standardized way of reading .env files which all developers know how to use.
Д
Then your code/repository is clean from secrets
Д
There is only one place to change those settings, the .env file
Bought
Who knows how can i practice my Django skills, are there any ideas?
Д
Am lost
You put into git a version WITHOUT the secrets. Then you can ignore it, I guess. Then add the secrets so they are only the local changes but never in git, or then multiple .env files
Azizbek Xushnazarov
Д
I use multiple .env files myself
Д
For example?
Practice TDD
Bought
Thanks 😃
Azizbek Xushnazarov
For example?
blog project. for ex
Harry gorilla
Harry gorilla
i also put my .env file to .gitignore
Harry gorilla
I don't know what you have done
Copy pasted this in my settings.py import os from os.path import join, dirname from dotenv import load_dotenv dotenv_path = join(dirname(__file__), '.env') load_dotenv(dotenv_path) SECRET_KEY = os.environ.get("SECRET_KEY") Then created .env file where the settings.py file is located and defined my secrete key there. I also installed python-dotenv
Harry gorilla
Am also getting unable to import dotenv yet i have installed python-dotenv
Д
Am also getting unable to import dotenv yet i have installed python-dotenv
make sure the package you install is python-dotenv and not dotenv