Abhie
what?
Tht random value
Abhie
Line 120
Charly
Tht random value
yes, but why you answered that when I told you a possible solutionm for your problem?
Charly
declare it inside the view
Charly
Did u understand my ques?
do you understand my answer?
Abhie
declare it inside the view
It is inside views
Charly
It is inside views
the view function not the views module
Abhie
the view function not the views module
Since I need to use that random value in multiple fn so i declared it global
Maxim
Since I need to use that random value in multiple fn so i declared it global
and that's why you get the same value code for all registering user
Abhie
and that's why you get the same value code for all registering user
Yess i needed the same value to show that code for further use
Abhie
But it is giving the same code for all registering user
Abhie
Sry but while i was using sqlite3 it gave different code for different user
Nasib
Hello everyone, I need help on my project, I have two models Product and Order, I sent relationship with foreignkey from Product model to Order model, so from Product model one column is connected to Order model. I want it so that when I delete something from Product model , in Order model if its active status about there is same that column with Product model , this should not be delete from the Product model. anyone can help me about codes in views in delete function, thanks.
Nasib
Brand is column in Product model and also in Order model with foreignkey order=order.objects.all() For x in order: If x.Product_id.Brand==0: Product=Product.objects.get(id=id) Product.delete () Else: Messages.warning(request, 'You can't delete Brand Because its active status '
Nasib
Explain in details what exactly the issue is
I haven't error just that's not correct codes
Nasib
It is working about active status I see that message when I want to delete active status But if I have different brands in Product that's not in order and active status I cannot delete that brands also so that's not correct codes
axi
Hi! Need help, please When I use filter in django admin it select not all objects, it select just first page How can I select all objects? Thanx
axi
Hope you could help)
Shabeeh
Is there a way for switching languages in a django application or is it more tilted towards the frontend
Nasib
Indents are all good? I mean in ur codes cuz its wrong here
Everything is working, and when I'm deleting any brand in Product model if it is same exist brand in order its not deleting and return that warning messages its working but if I want to delete any brand which isn't exist I didn't add in order that not deleted also (
Mahmood
Hi.. Do anyone know a Django package for admin tabs
axi
Hi! Need help, please When I use filter in django admin it select not all objects, it select just first page How can I select all objects? Thanx
Mahmood
Hi) Jazzmin Django jet
There is no any other that don't effect the theme?
axi
No Functional is stable and noneditable in most cases
Mahmood
what goals do you have?
I want to organize the fields in nice way I'm using django-admin-nested to do nested inlines But there alot of fields and models in the page I'm trying to organize them to be more understandable
Mahmood
I'm using django-admin-interface and i like it So just wanted a way to add tabs
Adorilson
Then how to use orm of django with mongodb
Did you read djongo docs? Get started is about this.
Y
yes. I passed the django tutorial
Doragonsureiyā
Then how to use orm of django with mongodb
Do you want to use Django with MongoDB? Then you shouldn't Please read this article: https://daniel.feldroy.com/when-to-use-mongodb-with-django.html
Anonymous
Just asking which database is more secured and perfect for production ready website? SQLite or PostgreeSQL?
~:$
Just asking which database is more secured and perfect for production ready website? SQLite or PostgreeSQL?
Postgresql. Even if you are developing the website..... use postgresql or mysql.... sqlite is good for small websites.
Xoxooxo
Hi Can anyone help me with Custom user model, Authentication backend
~:$
Hi Can anyone help me with Custom user model, Authentication backend
https://docs.djangoproject.com/en/4.1/topics/auth/customizing/ https://testdriven.io/blog/django-custom-user-model/ https://simpleisbetterthancomplex.com/tutorial/2016/07/22/how-to-extend-django-user-model.html take a look at these links. thank you
Yulian
I need to make a websocket endpoint, when connected to which every couple of seconds the user will send his geo-coordinates from the front, can someone tell me how best to implement the backend in terms of django-channels, maybe someone knows a tutorial or an article on this topic. The point is that this is not a chat, but a channel with only one user
Doragonsureiyā
Rule 5️⃣: Never post walls of text or screen photos. Use paste bins like https://linkode.org, https://nekobin.com (or your favorite one)
Xoxooxo
What's your problem?
I can elaborate if you want
Xoxooxo
https://stackoverflow.com/questions/74193685/custom-user-model-custom-authentication-not-working
Samrah
How can i send a post request in django with the authorization header where I have to put the api key
~:$
How can i send a post request in django with the authorization header where I have to put the api key
in authentication header.... bearer token.... are you taking about jwt token??? or any other API key?
Samrah
Like in axios, I can use the authorisation header
Samrah
I have to put my API key in there
Samrah
Request headers have a authorization property right
Samrah
Is there a way to set it?
~:$
you can set the header by yourself..... the pattern is "bearer token" something like that axios.get(YOUR_URL, { headers: { Authorization: `Bearer ${data.token}` } });
Samrah
Is there a way to do this in django? I'm trying to make a request to an api like that
Gud
Hello Can i use Django in an Android app for backend purposes? Like storing and reading data, authentication etc.
~:$
Is there a way to do this in django? I'm trying to make a request to an api like that
do you want to use axios in your django app???? you can try requests package for this.
Samrah
do you want to use axios in your django app???? you can try requests package for this.
I can use the authorisation header using the requests package?
~:$
Hello Can i use Django in an Android app for backend purposes? Like storing and reading data, authentication etc.
yes you can... but either you have to use graphql or rest api using django rest framework.
~:$
Can you please point me to an example share a link?
https://www.testcult.com/basic-auth-with-python-requests/
Anonymous
I have django project, project connect vue3 but django not found js? How can i solved?
~:$
I have django project, project connect vue3 but django not found js? How can i solved?
unable to understand your question. you can google how to connect django app with vue / (react,angular) frontend using rest api.
Mirco
Please use date object instead of string
django is smart enough, don't worry :)
User
Hello everyone! I want to make my internal web-site completely"offline" But one of my CSS files has this @import @import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@400&family=Poppins:ital,wght@0,300;0,400;0,500;0,700;1,300;1,400;1,500;1,700&display=swap'); It loads several "fonts" from fonts.googleap..... I'm working on something like a CRM project for the company and sometimes we have troubles with the internet connection The browser freezes if there is no internet so I want to make it more stable I tried to run "manage.py collectstatic", but failed What can I do in such a situation?
User
Download this font then manually in the css file
Yup In this case I got a list of lots of fonts from this link Can't I run something like "collectstatic+fonts"?)
Fredrick
Hello guys I need help on how to automatically generate user id and password on a Django app without the need of the user doing so himself, the generated passwords and user id should appear in the database. I've tried different ways but I haven't succeeded yet.
Kamlesh
Go through this url it will help full for you
axi
Hi guys Have a problem When I try to select all items in django admin in only selects just one page PLEASE HELP)