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: simple command line ./manage.py shell puzzle

2022-04-21 Thread cseb...@gmail.com
. The problem I think has something to do with how I inject it into the Django shell via "< test". cs On Thursday, April 21, 2022 at 12:18:04 PM UTC-5 larry.mart...@gmail.com wrote: > On Thu, Apr 21, 2022 at 1:06 PM cseb...@gmail.com > wrote: > > > > Why does this

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

2022-04-22 Thread cseb...@gmail.com
tly 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 I >

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

2022-04-22 Thread cseb...@gmail.com
red 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

Recommendation for effective captcha systems?

2022-04-29 Thread cseb...@gmail.com
I used some Django package called captcha but it seems spammers can bypass it. Is there a pretty nearly foolproof captcha people use instead? -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emai

How replace "./manage.py < some_code.py" with "./some_code.py" for website scripts?

2022-06-06 Thread cseb...@gmail.com
How replace "./manage.py < some_code.py" with "./some_code.py" for website scripts? There seem to be a number of imports needed to make the 2nd version work. cs -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group an

Re: How replace "./manage.py < some_code.py" with "./some_code.py" for website scripts?

2022-06-07 Thread cseb...@gmail.com
django.setup() > ` > > On Tue, 7 Jun 2022 at 04:17, Jason wrote: > >> Why? what's the purpose behind this? >> >> On Monday, June 6, 2022 at 12:27:58 PM UTC-4 cseb...@gmail.com wrote: >> >>> How replace "./manage.py < some_code.py" with &quo

Re: How replace "./manage.py < some_code.py" with "./some_code.py" for website scripts?

2022-06-07 Thread cseb...@gmail.com
2022 at 3:17:29 PM UTC-5 Jason wrote: > Why? what's the purpose behind this? > > On Monday, June 6, 2022 at 12:27:58 PM UTC-4 cseb...@gmail.com wrote: > >> How replace "./manage.py < some_code.py" with "./some_code.py" for >> website scripts? >

Removing "Invalid HTTP_HOST header" msgs with nginx.conf default server NOT working

2022-06-24 Thread cseb...@gmail.com
I constantly get the errors below in my Django server logs. To try to remove this, I added this to my Nginx server's nginx.conf file but it didn't work server { listen 80 default_server; return 444; } What else can I do to remove these err

Re: Removing "Invalid HTTP_HOST header" msgs with nginx.conf default server NOT working

2022-06-28 Thread cseb...@gmail.com
ble even under many seemingly-safe web server > configurations.* > > Assuming 3.208.32.109 is your server IP you should add it to ALLOWED_HOSTS. > > piątek, 24 czerwca 2022 o 19:00:23 UTC+2 cseb...@gmail.com napisał(a): > >> I constantly get the errors below in my Django

Why turning off these uWSGI options fixed problem with 100% CPU spikes and freezing?

2021-06-26 Thread cseb...@gmail.com
One Django website was freezing about every HOUR with no indication in logs what the problem was. I was seeing CPU utilization spike to 100%. I removed these switches below and it seemed to have fixed the problem. --master

Re: Why turning off these uWSGI options fixed problem with 100% CPU spikes and freezing?

2021-06-26 Thread cseb...@gmail.com
UPDATE: The Django app stays up longer without these switches but now after about half a day the MEMORY spikes? I'm seeing the % memory used go up to around 80% which again freezes this Django app. I'm enabling verbose logs now. Any idea what would cause this behavior? cs -- You received th

Basic questions about scaling a Django web app. (e.g. AppEngine solves all problems?)

2021-08-23 Thread cseb...@gmail.com
I have a simple web app (bighelp.business). I anticipate the number of users to steadily increase. I'm having nightmares of having to guesstimate how much extra RAM and cores to add every week. Furthermore, WSGI has these switches I use... --processes=5 and --max-requests=50. I don't know ho

What is different about "./manage.py shell" vs. normal Python shell that makes this list comprehension not work anymore?

2021-09-20 Thread cseb...@gmail.com
I noticed a list comprehension bombs in the "./manage.py shell" shell that I think would be ok in normal Python shell. What is different about "./manage.py shell" that makes it not like certain list comprehensions? Here is the code erase that I run this way..."./manage.py shell < erase" import

How send data to Django app using Javascript or JQuery? (Having trouble doing a POST)

2021-09-29 Thread cseb...@gmail.com
How send data from client Javascript to Django server? I tried the following but it didn't work. I want to read "token" cookie value and send to server but it never receives it as a valid form. Any sample working code greatly appreciated. function start_processing() {

django.contrib.auth.update_session_auth_hash not working after change password

2024-11-05 Thread cseb...@gmail.com
When I change a password, users are logged out. Django recommends keeping users logged in by calling django.contrib.auth.update_session_auth_hash(request, user). This is not working in a Django website of mine. They must log in again!? There are no error messages. Is there any way I can provide

Re: django.contrib.auth.update_session_auth_hash not working after change password

2024-11-08 Thread cseb...@gmail.com
/stable/topics/auth/default/) > > On Thu, Nov 7, 2024 at 11:44 PM cseb...@gmail.com > wrote: > >> Ruby >> >> Thank you very much. I tried adding the request argument to my form >> subclass >> and got this... >> >> AttributeError: 'WSGIRe

Re: django.contrib.auth.update_session_auth_hash not working after change password

2024-11-07 Thread cseb...@gmail.com
From is missing `request`, it should be as it is below >> form = grandmas4hire.forms.ChangePasswordForm(request, request.POST) >> >> >> On Wed, Nov 6, 2024 at 8:20 PM cseb...@gmail.com >> wrote: >> >>> Ruby >>> >>> Thank you

Re: django.contrib.auth.update_session_auth_hash not working after change password

2024-11-07 Thread cseb...@gmail.com
o be refactored, here is the real deal, your > ChangePassowrdFrom is missing `request`, it should be as it is below > form = grandmas4hire.forms.ChangePasswordForm(request, request.POST) > > > On Wed, Nov 6, 2024 at 8:20 PM cseb...@gmail.com > wrote: > >> Ruby >

Re: django.contrib.auth.update_session_auth_hash not working after change password

2024-11-06 Thread cseb...@gmail.com
:09 PM UTC-6 Ruby wrote: > How was it implemented? > Show a snippet from your code > See how it was used in my code > > form = ChangePasswordForm(request, request.POST) > if form.is_valid(): > user = form.save() > update_session_auth_hash(request, user) > messages.success( >