Koen de
How to connect thr portage database with orm
Tricky. Because “Portage” is not just a database. From the Gentoo devs; https://gpo.zugaina.org/dev-python/peewee The question has been asked on reddit as well; https://www.reddit.com/r/Gentoo/s/LuBgtRuXj0 Keep in mind that this is not perse related to Django
Koen de
is there anyone who has worked with internationalization and localization? in general doing many-language-web-site?
Yes. Two ways; With the Django standard https://docs.djangoproject.com/en/4.2/topics/i18n/translation/ Second with a React frontend where Django is only used for ORM/REST. Those translations have been done with https://github.com/i18next/react-i18next
Sarvar
who can solve this issue i have used ellastic search in my project Connection error caused by: ConnectionError(Connection error caused by: NewConnectionError(<urllib3.connection.HTTPConnection object at 0x7f8bf2848af0>: Failed to establish a new connection: [Errno -2] Name does not resolve))
Рома
Hello. Making simple mock server for testing usage with drf. Have endpoint for object status. Depending of real object status some field must exist or not. What is best prectice? 1) have 2 different serializer. Each for required fields list 2) have 1 serializer and override to_representation method and populate data with extra fields using "if" statement 2 option seems to me less obvious, and probably realy bad decision
N*!M
hi. i have index html file and i want to load static tag in it. but its many src img code in it. i want a way for doint all them in best way
N*!M
there is no plugin in pycharm?? its noe best way. think you write a milion code in facebook . ))))
Doragonsureiyā
there is no plugin in pycharm?? its noe best way. think you write a milion code in facebook . ))))
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.
cj
there is no plugin in pycharm?? its noe best way. think you write a milion code in facebook . ))))
Refactor -> Rename (or Ctrl+F6) but it's totally offtopic and nothing related to Django at all
Dihfahsih
Django version 5.0 has really some cool improvements please devs checkout it could be fun
NARASIMHA
When deployments happen or by chance any worker are killed i want my running celery task to update sone status in database What way can i achieve this
NARASIMHA
What have you tried
was trying signals, which calls when Signal terminate is called
NARASIMHA
this works wor warm shutdown but coldshutdown, sigkill doesnt trigger the signal
NARASIMHA
What if any process is killed?
NARASIMHA
the post run signal will not be called
Dihfahsih
the post run signal will not be called
There are limited options for that when the process is killed
Dihfahsih
But you can try to handle it using periodic db updating
NARASIMHA
https://docs.celeryq.dev/en/stable/userguide/signals.html#id29 there is this worker process shutdown signal, But it doesnt guarantee everytime
NARASIMHA
@dihfahsih anyway i got your code, but didnt get where you update the database when the process is killed My only concern is for killed processes which happens during deployments or load increasing or during any service restart
Subodh
Actually I am new to Django, can anyone suggest me a better resource from where I start my learning journey.
Doragonsureiyā
Actually I am new to Django, can anyone suggest me a better resource from where I start my learning journey.
Looking for Django tutorials? you can follow these three recommended ones: * Official documentation and tutorial * Tutorial from MDN * Tutorial from django-girls
N*!M
can you send me a code for change all them? after ctrl + f ?? i dont know how to repleace all them with add {% static ——— %} in it
Branko
When I host my website my comment form don't work because csrf token dont let 403 error I have. How to solve this problem? On local mashine work normally.
renji
K bro
Branko
Is csrf token set? Is csrf setting set?
How do you mean? I set in my html template csrf in my comment form.
Dev
which is better way to build forms ??Modelforms or custom HTML forms
renji
I had created the template
Muflone
How do you mean? I set in my html template csrf in my comment form.
They are two things In the template you have to pass csrf_token In the settings you have to specify the hosts for csrf
renji
But how I connect all the products
Doragonsureiyā
But how I connect all the products
What are you talking about?
Branko
They are two things In the template you have to pass csrf_token In the settings you have to specify the hosts for csrf
Tell me more. How to host csrf how need to look my settings.py and which two things need to have in my form? I have only csrf on top on my form write in django way.
Branko
Explain what's not clear. I already told you what to do
Ok thank you I need to figure out how to host csrf in settings
Muflone
Ok thank you I need to figure out how to host csrf in settings
It's a native setting, open the file, use the search and you'll find it
Branko
It's a native setting, open the file, use the search and you'll find it
Okay thank you and for default that not exist of course?
Muflone
Okay thank you and for default that not exist of course?
https://docs.djangoproject.com/en/4.2/ref/csrf/ Please don't be lazy, when someone points you something use any search engine to get the needed clarification (first google result with csrf Django). The huge jump between remaining noob and starting to become pro lies here: to be able to use the documentation and the search engines
Valentin
Could it be that certbot doesn't let me use return redirect()? Does anyone know how to change it?
Charly
Could it be that certbot doesn't let me use return redirect()? Does anyone know how to change it?
Certbot has nothing to do with how redirects work so better explain your issue
Valentin
The statement "return redirect('index.html')" does not work for me
Valentin
render, HttpResponse yes
Emmanuel
Please I am trying to serve images from my document directory using nginx, but I keep getting 403
Emmanuel
No
Emmanuel
I don't want to change nginx user, I just want to allow nginx user to access my images inside documents directory
Valentin
it gave me a lot of trouble and the only way I found was to change the name.
Emmanuel
Wow what did you change it to, root, or username
Valentin
/etc/nginx/nginx.conf change user wwwdata to root
Emmanuel
Thanks
Valentin
did you solve it?
Emmanuel
I will do that after trying a few methods
Emmanuel
did you solve it?
It worked, thanks
Valentin
Try return redirect('/')
It doesn't work, it must be a bad nginx configuration or something like that
Emmanuel
Is it in Django or nginx config
Valentin
for a filter and redirect is used for the django admin panel
Emmanuel
Try return redirect('/')
What error is it throwing after trying this
Valentin
Curiously, none of them, in production it works perfectly, but when it comes to deploying to the vps it doesn't work for me
Anonymous
hello am working on a project and am using crispy form for my login but the form form field is not showing pls what can i do
Anonymous
hello am working on a project and am using crispy form for my login but the form form field is not showing pls what can i do https://linkode.org/#TrowxvtKim4tz7OixeO9g6
Julianto
How to run Django with Tailwind CSS without using a CDN?
Charly
How to run Django with Tailwind CSS without using a CDN?
You download the file from CDN and serve it as any other static file.
ashu
Hey guys I have small doubt I created a double page form when user fill the form they only save the one form data
Ritik
Hey. I have been trying to implement Microsoft oauth2 in my django app. While trying to sign in this error pops up AADSTS90019: No tenant-identifying information found in either the request or implied by any provided credentials.
Ritik
Any suggestions what I might be missing
Anonymous
Does anybody tell me how to add a static file in django
I'm
Does anybody tell me how to add a static file in django
Search it on YouTube. I solved it with videos on YouTube. They were working.
Anonymous
Search it on YouTube. I solved it with videos on YouTube. They were working.
I did it but I had an error file that did not exist
Doragonsureiyā
I did it but I had an error file that did not exist
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
Valentin
I have a problem with the return redirect() statement in the vps, it animates the redirection but it doesn't work. In production I was doing well, any ideas?
Muflone
any requests containing the expression doesn't work receive no help
Valentin
Sorry, but it literally doesn't leave a record in the logs, nor does it give me an error
Kesav
Can anyone guide me how to implement OTP authentication in login form using django