Re: simple command line ./manage.py shell puzzle

2022-04-21 Thread Antonis Christofides
It works fine here. I entered your commands exactly and the second one does not provide any output. What shell do you have? And what version of Python and Django? And what OS? On 21/04/2022 22.28, cseb...@gmail.com wrote: Yes I agree.  But why does it complain that datetime doesn't exist when

Re: Connection timeout error with Postgres

2022-04-21 Thread Antonis Christofides
Hi! I shall assume that PostgreSQL is listening on port 5432. "Connection timed out" means that the client (Django/psycopg2 in this case) is not getting any response—as if the PostgreSQL server machine did not exist. ("Connection refused", on the other hand, means that the PostgreSQL server ma

Re: Calculations Between Models

2022-04-21 Thread techg...@gmail.com
Hello Derek, Your solution worked, I appreciated the help. Regards. On Wednesday, April 20, 2022 at 5:50:25 PM UTC+3 Derek wrote: > Not sure what the "@aproperty" are here for, but in your views.py file, > you could do this calculation, passing in the ID of the staff record: > > from .models i

Support d'aide en Django

2022-04-21 Thread Djeneba Kaba DIAKITE
Bonjour je suis nouvelle en django et j'aimerai l'utiliser avec react native. Et pour cela je dois combiner django et postgres . Besoin de guide , tout aide me sera précieuse ( support , site, cours etc...) Cordialement -- You received this message because you are subscribed to the Google Gro

Django FormTools

2022-04-21 Thread ahmed doudou
hey everyone i'm using Django with wizard form and everithing work fine but i don't know how to styling inputs and i don't know how to save data on my database. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and

quote_from_bytes() expected bytes

2022-04-21 Thread Kaya Kwinana
Hi I am using Django 4.0.4. I am getting the TypeError quote_from_bytes() expected bytes when I save my model after creating a task. When I backspace, the create form is still there on the screen as if not saved. When I go to List View or Detail View, I find that everything went OK. The erro

Connection timeout error with Postgres

2022-04-21 Thread Disha Patel
Hi, I am facing below connection timeout error while using Postgres as database for my Django application. "psycopg2.operationalerror: could not connect to server: connection timed out: Solutions tried: 1. increased timeout at server end. 2. added conn_max_age in the settings and tried multi

How to 301 redirect django url with multiple slashes on url path?

2022-04-21 Thread Tanata Giventa
I am trying to figure out how to redirect properly some urls that contain multiple slashes and create a permanent 301 redirect whenever the slug changes. For example: A - https://example.org/category/subcategory/article-name-A B - https://example.org/category/subcategory/article-name-B I wa

QuerySet Caching of ManyToMany fields

2022-04-21 Thread Russell Melick
Hi All, We've been working on improving the performance of our backend recently, and have started analyzing the database queries generated by Django more thoroughly. We quickly realized that we were mis-using our ManyToMany fields. We had assumed that the results of accessing an M2M field wou

Django

2022-04-21 Thread Abdulfarid Olakunle
Please how do I import a model from another app. Thanks, please someone should help me out -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr.

[no subject]

2022-04-21 Thread adamlaska
adamlaska -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.goo

Re: Calculated Fields

2022-04-21 Thread Ahmedrufai Otuoze
My bad. I bypassed your message completely. Have a great day! On Wed, 13 Apr 2022 at 18:32, Kasper Laudrup wrote: > On 13/04/2022 16.51, Ahmedrufai Otuoze wrote: > > This is not a spam. I just tok a course on that aspect and wanted to > help. > > No strings attached. > > > > I may have gone aga

Re: simple command line ./manage.py shell puzzle

2022-04-21 Thread Larry Martell
On Thu, Apr 21, 2022 at 2:53 PM cseb...@gmail.com wrote: > > The script should quietly exist without error. > > I actually have a longer script that is the real workhorse. > I just made this tiny one to showcase the issue. > > I can past > > import datetime ; [datetime for e in [1, 2]] > > into a

Re: simple command line ./manage.py shell puzzle

2022-04-21 Thread cseb...@gmail.com
The script should quietly exist without error. I actually have a longer script that is the real workhorse. I just made this tiny one to showcase the issue. I can past import datetime ; [datetime for e in [1, 2]] into a regular Python3 shell as well as the Django shell and all is fine. Th

Re: simple command line ./manage.py shell puzzle

2022-04-21 Thread Larry Martell
On Thu, Apr 21, 2022 at 1:06 PM cseb...@gmail.com wrote: > > Why does this fail?... > > % echo "import datetime ; [datetime for e in [1, 2]]" > test > > % ./manage.py shell < test > > Traceback (most recent call last): > File "./manage.py", line 8, in > django.core.management.execute_from_c

simple command line ./manage.py shell puzzle

2022-04-21 Thread cseb...@gmail.com
Why does this fail?... % echo "import datetime ; [datetime for e in [1, 2]]" > test % ./manage.py shell < test Traceback (most recent call last): File "./manage.py", line 8, in django.core.management.execute_from_command_line(sys.argv) File "/usr/lib/python3/dist-packages/django/core/ma

Re: Fetching Data Between Models

2022-04-21 Thread Derek
You've already posted the same question: https://groups.google.com/g/django-users/c/f7ZH2pcZp0s On Wednesday, 20 April 2022 at 16:44:19 UTC+2 techg...@gmail.com wrote: > I have a model Staff and LeaveReportStaff, I wanted to get leave_balance > between Total_Leave_Days and leave_days. I already