Anonymous
Anonymous
Thats why its called automation
Anonymous
Assalamu alaikum. How aws s3 works? for example I want to save files in storage, how files are saved in storage?
Mirco
This package makes the work for u
Mirco
It uses boto3 to talk with AWS
Anonymous
django-storages
this saves file as byte yes? but this method is not slow?
𒂵𒐊𒍝𒊏
😔
𒂵𒐊𒍝𒊏
any one can help me in my project in django??
Doragonsureiyā
any one can help me in my project in django??
Don't ask meta questions like: "Any user of $x here?" "Anyone used technology $y?" "Hello, I need help on $z" Just ask about your problem directly! With ~80,000 people here, the probability that someone will help is pretty high. How to ask smart questions: http://catb.org/~esr/faqs/smart-questions.html
Mirco
any one can help me in my project in django??
isn't clear enough you cannot write members in PM ?
Akash
Any one doing lottery project based on django rest api please need help 🙏
Georgev:
Does anyone can send a tutorial about polls in django?, Or a Youtube channel about that?, I'm creating lm but i'm stuck
Anonymous
nope
thank u
Georgev:
Official documentation
It does'nt work for me
Georgev:
It always work
I'm sorry, i'm creating a diferent poll, its a satisfaction poll, it really works?
Mirco
It does'nt work for me
it does not mean another tutorial will work u need to understand what u write
Bad
Hello i want to add a form in a website django but i have many problems with the forms and GEt or Post method can you help me please.
Doragonsureiyā
Hello i want to add a form in a website django but i have many problems with the forms and GEt or Post method can you help me please.
Please provide a full explanation including all the details that you consider relevant. Your statement is too broad and there is no clear way to answer you, you have to explain: - what you're doing - what you're expecting - what you're using - where you're running the script - what Python version you're using - what packages and their versions you're using - and the most important thing: show the code YOU wrote (read rule 5️⃣ for that) and more details, that way your chances to get help will increase
Amr
Field is not recognized by Django in DB. Make sure you have applied migration and this db field is created
Thanks, you are right the field is not in the table , but there is an error , because the table has a strange column that I haven't created in my model and it's not included in the migrations folder in 0001_initial.py... and also I performed the makemigrations and migrate many times
Amr
Now I'm dropping the table and build it again , but I think I will need to delete it from django_migrations table
Amr
Field is not recognized by Django in DB. Make sure you have applied migration and this db field is created
Many thanks , your suggestion fix my issue, but I don't know why this conflict happen... anyway thank you so much
Mirco
Doragonsureiyā
Thanks
You're welcome! 😊
Akash
How to call a django api within another function using url ?
Akash
Use reverse
I want to use below API function in wsgi.py But not able to get it working views.py @api_view(['GET']) def fetch_scheme_data(self): .......... return Response(content, status=status.HTTP_200_OK) urls.py path("fetch_latest_schemes_data/", fetch_scheme_data, name="latest_scheme") wsgi.py from django.urls import reverse reverse('fetch_latest_schemes_data') It returns: fetch_latest_schemes_data is not valid function or pattern name
Akash
Mirco
I want it to run on server start
You need to call the API in your client, for example in a HTML file
Mirco
It does not have any sense to call it inside wsgi file
Akash
You need to call the API in your client, for example in a HTML file
That would lead to API call whenever same HTML file is rendered in future
Akash
I want it to run on server start
Looks like django hooks can be used for same https://stackoverflow.com/questions/6791911/execute-code-when-django-starts-once-only#:~:text=Basically%2C%20you%20can%20use%20%3Cproject,or%20import%20a%20particular%20module.&text=But%20that%20command%20won't,other%20code's%20changes%20as%20well.
Mirco
It can be done but what is the sense ? You are mixing client and server
Mirco
You need to send data to a client that will use them to do something with
Mirco
That would lead to API call whenever same HTML file is rendered in future
What u r talking about ? I don't know what in your project schemes are, but I imagine you have some frontend that need to do something with these schemes
Akash
What u r talking about ? I don't know what in your project schemes are, but I imagine you have some frontend that need to do something with these schemes
I have created a API to update obsolete data within my backend(django) code. I will call this API preodically Externally to update data BUT I also want to automatically call it in case of server re-start, Thats why no interaction to client
Mirco
It makes much more sense
Akash
And why don't u use something like cron or celery to call periodically your API ?
But how would celery trigger it in case of server restart ? As celery will be running as different process
Doragonsureiyā
Alright, thanks, I will look it up
You're welcome! 😊
Oleg
Guys, does it make sense to use .select_related for onetoone field?
Abdalwhab
I want to hide the password encryption from the admin page
Anonymous
Should I use django admin in production?
Shivam
Hello.... I make a Rest API in Django and now i have to apply multithreading and multiprocessing... can anyone give some suggestions?
Abdul
Does anyone have experience integrating PayStack with a Django website, I'm ready to pay for it.
Shivam
hello it's my first time that I'm going to deploy my Django project in production so can give me some suggestions?
Shivam
ok
Vinay
How 2 write API 's?
Doragonsureiyā
How 2 write API 's?
Are you looking for Django REST Framework documentation? Here you have it: https://www.django-rest-framework.org/
kraus
Help, please, make friends the clean method in the form with the save method in the models. Error: 'InMemoryUploadedFile' object has no attribute '_committed', swears at the line: super (Image, self) .save (* args, ** kwargs) https://dpaste.org/trxp
Mister
A function login() for connected user takes how many argument ?
Андрей
Hi, can anybody explain how to use prefetch_related on model instance? i want to get one model instance from database and then get related objects
Андрей
i have 3 models A(main model) B( with ForeignKey(A, related_name='all_B')) C( with ForeignKey(A, related_name='all_C')) i can use A.objects.filter(id=1).prefetch_related('all_B', 'all_C')[0]
Андрей
but i don't think that is good solution
Андрей
i can't use .first() after prefetch_related, because .first() function hits database again
Андрей
u have ForeignKey so u need to use select_related
nope, if i want to get A model with all related B and C models, i need to use prefetch_related
Андрей
otherwise i will get an error: FieldError: Invalid field name(s) given in select_related:
coderss
Ok
Mirco
you have foreign keys so the ORM requires select_related
Mirco
if u don't trust me, read the doc
Андрей
prefetch_related must be used with M2M.
not only) prefetch_related can be used with M2One
Mirco
not only) prefetch_related can be used with M2One
never seen so far a prefetch related with foreign keys but yeah I can go wrong