Vipul
Can anyone send any tutorial or something
Doragonsureiyā
Can anyone send any tutorial or something
These single steps will help you a lot: Step 1️⃣: Open a browser Step 2️⃣: Write down https://google.com or https://duck.com and press Enter Step 3️⃣: In the search box, write down the same words you asked here Step 4️⃣: Read the first results
Dhurke Sahdmadhi
Cuz that is correct. Your qs would not be evaluated and no call to database is done unless you try to do an operation which requires to return data
basket = Basket.filter(category=fruits) f1 = basket.get(name="orange") f2 = basket.get(name="apple") Is the the query to db carried twice because 2 operations are performed on it? Or is the queryset stored in memory then subsequent operations performed on it?
Rohan
basket does nothing but creates a query
Rohan
But doesn't execute it
Rohan
Also, that .get will give you an error, I hope that is a sample code
Dhurke Sahdmadhi
Dhurke Sahdmadhi
But doesn't execute it
After executing it the first time when creating f1 is it executed again while creating f2? If yes how to store the results to avoid db reads?
Rohan
After executing it the first time when creating f1 is it executed again while creating f2? If yes how to store the results to avoid db reads?
1. Yes, it will do 2 read queries on DB. 2. It will return a queryset, which is a list, you cannot do a .get() on it 3. If you want to keep the whole data in memory from that filter, do a .values() after your.filter and save it to basket.
Jamie
Can one give me reference for cors setup for desktop application
Maxim
Can one give me reference for cors setup for desktop application
https://www.google.com/search&q=django+cors+desktop+application
Jamie
https://www.google.com/search&q=django+cors+desktop+application
In case of web application i will allow CORS_ALLOWED_ORIGINS =[ "https://example.com" ]
Jamie
What should I do for a desktop application
A
How can add mongoDB in my database in Django
A
mongoDB it is useful with Django
Anonymous
use pymongo
A
how?
Speed performance and other things
A
Yes
A
Ok
Anonymous
Ok
let us discuss in more detail
Muflone
mongoDB it is useful with Django
You'll regret soon
Doragonsureiyā
mongoDB it is useful with Django
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
Kumar Shreyansh
Hi, i have two different forms in the same html page, one wraps a table and another is in a modal. When I submit the form in one, it shows csrf error forbidden
Kumar Shreyansh
How can I fix it
Kumar Shreyansh
Yes, i have two forms with two csrf tokens in the same page. Forgot to highlight that part
Faraz
Kumar Shreyansh
Yes, i am well aware of that 😅
Kumar Shreyansh
Instead of having two form tags, shall i wrap the entire content in one?
Anonymous
I think you should send some part of your code.
Kumar Shreyansh
Yes a moment
Anonymous
Okay
Doragonsureiyā
Yes a moment
To share code or error tracebacks, use a pasting service, like: - https://linkode.org - https://dpaste.org
Muflone
Instead of having two form tags, shall i wrap the entire content in one?
You can have as many forms you want, it's not relevant When you submit the request, you submit only one form. Such form must pass the csrf token
Kumar Shreyansh
You can have as many forms you want, it's not relevant When you submit the request, you submit only one form. Such form must pass the csrf token
I am trying to set a session variable when I click on a record in the table. Bcos it requires a post method, i wrapped it in a form tag in standard django format. On refresh, the csrf token gets destroyed and the session returns an error
Anonymous
send your code
Kumar Shreyansh
https://dpaste.org/9QTXr
Kumar Shreyansh
There is only one form, the add button redirects to another page actually
Anonymous
Okay
Kumar Shreyansh
It keeps throwing 403 error during testing
Muflone
It keeps throwing 403 error during testing
Use the browser console to check if the token was sent and it's expired or wrong or if it wasn't passed Each post request must carry the csrf token
Kumar Shreyansh
Hi, I am using a jquery ajax request to debug the functionality as well. And csrf token doesn't show up the first time and has to be refreshed every time before clicking on another record
Muflone
You have to learn to debug your code so you can learn what are your errors
ashu
You'll regret soon
Which database is best with django
ashu
ok, thanks
Try envato bro
Muflone
Which database is best with django
postgres sqlite only for very small projects
Maxim
Which database is best with django
what's best for Alice won't be best for Bob
ashu
postgres sqlite only for very small projects
Ohk I have normal question I used postrgres database that run on different machine or server I have to open a full day a machine
Anonymous
What is django? I mean what it is used for?
ashu
It is have any cost for maintenance
Anonymous
ashu
What is django? I mean what it is used for?
It is a backend framework like node js or PHP laravel
Muflone
It is have any cost for maintenance
are you asking me if you have to pay your server?
ashu
are you asking me if you have to pay your server?
Like normally if I have a big project and I was use a postrgres so I have to pay any thing
Muflone
Like normally if I have a big project and I was use a postrgres so I have to pay any thing
on a big project you need to pay competent people, the servers, the cdn, the hosting, caching and many other things, including the costs to keep the database
Muflone
postgres is free software, you don't have to pay to use on a real business you have to pay people to make sure everything works fine
Malik
Anyone can give me suggestion
You mean, you'll use django for dssktop apps.
Muflone
Anyone can give me suggestion
there's not a correct answer the requests made from a desktop application are not different from a web application
Максим
How can I override the retrieve, update and destroy ModelViewSet methods so that they don't search for an object by <pk>, but instead use self.request.user? Or just it needs to configure the router? I want CRUD via url "user" instead of "user/<pk>" I can override get_queryset, get_object, but how can I do CRUD via url "user" instead of "user/<pk>"?
Максим
if you don't need a specific object, then you need a bare templateview
Hm... How can I get, create, update object as simple as using ModelViewSet? Is TemplateView supports serializer_class?
Muflone
Максим
Zokirshoh
Try envato bro
is it only paid?
Mohsen
Hi guys How i can use vue.js in django?
Shahzodbek
Hi guys How i can use vue.js in django?
Of course you don't add vue to django 😁. You must have two separate projects, one for vue, one for django. And use api to send data from backend to frontend
vijay
Which database is best with django
Depend on ur data transaction If u are making an analytical app use oracle otherwise use MySQL or postgress