parandhamudu
Ho using db or files
Divya
Ho using db or files
I'm using files
parandhamudu
Frist end to create api
parandhamudu
Read files using glob
parandhamudu
After fitting model ok
Sergey
Hi, who knows why get_or_create can raise multiple objects returned?
Sergey
parandhamudu
Same way like that
Sergey
It's bcz of get
i understand, but how it possible?
Sergey
Using abstraction in model
what kind of abstraction?
Vaibhav
i understand, but how it possible?
What you mean, by possible
parandhamudu
Multiple columns to connect with single table to table
Sergey
is add function on m2m field create object of model that connected?
Sergey
or just object of "through"?
Vaibhav
It creates objects in through table
Sergey
than if i have two fields(for get or create), how its possible to get more than one objects? * if i always used get_or_create..
parandhamudu
Table to table possible , columns to tables also possible
Vaibhav
Ummm
Sergey
Model.objects.get_or_create(field_1=value_field_1,field_2=value_field_2)
Vaibhav
You are querying using get and in get, it can return more than one object
DeepState
I want to get all data from my database and not only one.my code in the views and html
Sergey
You are querying using get and in get, it can return more than one object
yes I know, but if used this construction and nothing else, it mustn't to raise such situation, as I think🤔
Vaibhav
yes I know, but if used this construction and nothing else, it mustn't to raise such situation, as I think🤔
You can use Models.objects.filter(**{your_fikters}) And see how many objects they return
Vaibhav
It depends on your table schemes, to what is unique/ pk and what is not
Anonymous
Hi everyone, i have a question somebody where able to start a project on Django/Windows subsystem linux distribution (WSL) without Sqlite as database and if thats the case which database did You applied and how? Because i got
Anonymous
trubbles with it thanks anyway
Phill
Hey guys, is docs.djangoproject.com up for you guys?
Anonymous
Hi, please help. The programmer left one on one with the Django project, and I need to open the database according to him, psql and get all the usernames from there, everything is there to enter, but while I tried to go through python and downloaded everything, then I got the admin panel and apparently the whole project. don't care for the project, I need usernames. how can I get it. when I try to access this database through python, I write an error
Stefan
Hi everyone, i have a question somebody where able to start a project on Django/Windows subsystem linux distribution (WSL) without Sqlite as database and if thats the case which database did You applied and how? Because i got
The default database while creating a Django project is a sqlite3 database. But you can configure your settings (databases section) to use another database instead of the default one. You can use i.e. MySQL, PostgreSQL, MongoDB, and any other database that Django supports. But while creating a project you can't choose the database that will be created
Stefan
thanks
U r welcome
Alcides
Hi! Everyone. Please I would like do deploy my python-django application using docker. I Would like to use 2 docker container: One to apache and wsgi and another one to python itself. Please, I am looking for a docker-compose.yml file as an example. Thank you very much in advanced for any help.
Michel
Hi, I'm trying to whitelist my localhost from CSRF CSRF_TRUSTED_ORIGINS = [ '127.0.0.1:8000', 'localhost:8000' ] but I'm still getting Forbidden (CSRF cookie not set.) error
Rohan
How to upload my project so that I can send to anyone using link
Rohan
And where to upload it?
Doragonsureiyā
How to upload my project so that I can send to anyone using link
Your question is not related to Django. If it's a Python related question go to @Python group, otherwise please move to @PythonOfftopic group and ask there.
Shadow
Stack overflow
इमरान عمران Imran
Hi, I'm trying to build a stripe payment integration in django, I want to know what's the best practice to store the secret keys
Michel
You need to modify allow_hosts in settings
you mean the ALLOWED_HOSTS variable ?
Anonymous
Yes
Michel
Well, no, it didn´t work
Michel
I've got the allow host error before, but I'm not getting it now even when ALLOWED_HOSTS = []
Anonymous
ALLOWED_HOSTS = [here you need to add those local host ]
Michel
I did it, no change
Michel
But why would it be necessary for the CSRF ?
Anonymous
Did you add {% csrf_token %} to form
Michel
Did you add {% csrf_token %} to form
No, I'm just sending a request, I'm making a REST API
Michel
and right now I want to whitelist localhost
Axror
Hi everyone. I am going to create place address search app. How can I do it. pls help
Sergey
Hello everyone! Who knows what it's mean(below), and to create objects of m2m with through properly? Method 'add' cant be used with many-to-many relations if intermediate model is used. consider call it on intermediate model manager.
Sergey
or I can just ignore it?
Anonymous
and right now I want to whitelist localhost
Actually this has nothing to do with the host Django expects csrf for post requests, either you disable with csrf_excempt decorator or class to view Or send authtoken in the request @michelromero
Michel
but what about this then https://docs.djangoproject.com/en/3.2/ref/settings/#csrf-trusted-origins
Anonymous
but what about this then https://docs.djangoproject.com/en/3.2/ref/settings/#csrf-trusted-origins
@michelromero If this is the issue, I think you would have gotten host not allowed exception rather than csrf ... not so sure
Michel
why?
Anonymous
Are you using any auth?
Michel
Are you using any auth?
I'm using the auth that comes default, I'm using the admin, not sure if that's what you mean
Anonymous
Lok
Anonymous
Ok
इमरान عمران Imran
Mirco
thnx
Or if you are using cloud platforms, you have services like Secrets Managers
इमरान عمران Imran
Martín
hi, I'm with a django webapp against legacy database, tests are working creating the test database on-the-fly but now I want to create some data in order to run the test with this data, is there any strategy for creating data in this temporal database to be deleted after the test process? I've been reading something about replica databases, but I'm not sure if this is what I need
Mirco
I'll be using heroku
You can just set the environment variables in Heroku and that's it
Anonymous
Has anyone worked with celery and drf extensively? I need a help
Doragonsureiyā
Has anyone worked with celery and drf extensively? I need a help
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
Anonymous
Has anyone worked with celery and drf extensively? I need a help
So suppose added a data in the database, I have to schedule that task of processing the data and no more than 90 tasks can be scheduled per hour How to achieve this
Anonymous
Yes
Anonymous
You can use exclude
Martín
Use fixtures
Any resource or link you could provide?