Hi folks, logging into django admin fails when 'log in' button is pressed first time, but pressing "back" and "log in' again - logs the user in successfully.
I am deploying Django app with zc.buildout here, with a setup similar to what is described here http://www.meppum.com/2009/jan/17/installing-django-ubuntu-intrepid/. Nginx (listening on 127.0.0.1:8003) is running beyond Apache(listening on 127.0.0.1:8001), configurations of both servers are provided at the end of the post. I'm accessing my django app as 127.0.0.1:8003. So, 127.0.0.1:8003/admin/ opens django admin login form. 1)Entering username/pass, pressing "log in" redirects to 127.0.0.1/ admin, therefore ends up with nothing, as there is no server listening on 80 port. Browser sends: POST /admin/ HTTP/1.1 Cookie: Kapow_Graphs=SUM%2C1%3ATBL%2C1%3ATER%2C1%3ATHR%2C1%3ARCR%2C1%3A %23MEM%2C1%3AQR%2C1%3AER%2C1%3ARPCS%2C1; sessionid=9b1b072a02f9ff3297442285729d5010 (sessionid value, at the time of pressing 'log in' matches the one which is present in django db, in the 'session_key' column of the single row in django_session table. Nginx returns : HTTP/1.x 302 FOUND <..> Set-Cookie: sessionid=5d2af76b5ea0b6f19d81e71690515d20; expires=Fri, 12-Feb-2010 21:35:59 GMT; Max-Age=1209600; Path=/ <..> The old row in django_session is replaced with the new one, containing the session from the Nginx returned 302 response. 2)Pressing browser's back , and 'log in' button once again (or pressing browser's 'back' and 'refresh') logs in succesfully into 127.0.0.1:8003/admin/. It looks like that's a cookie-related issue, but, i guess, the root of the problem might lie in the apache and/or nginx config as well. Any ideas how to make the admin log-in form work immediately? Cheers! to P.S.configs: ===== apache vhost configuration === <VirtualHost *:8001> <Directory /home/toinbis/Desktop/programming/project/runtime/ htdocs/django_wsgi/> Order deny,allow Allow from all </Directory> WSGIDaemonProcess tsd user=www-data group=www-data threads=25 WSGIProcessGroup tsd WSGIScriptAlias / /home/toinbis/Desktop/programming/project/ runtime/htdocs/django_wsgi/djproject.wsgi LogLevel warn ErrorLog /home/toinbis/Desktop/programming/project/runtime/logs/ apache_tsd_error.log CustomLog /home/toinbis/Desktop/programming/project/runtime/logs/ apache_tsd_access.log combined ServerName localhost </VirtualHost> === nginx configuration === daemon off; #user www-data; worker_processes 2; error_log /home/toinbis/Desktop/programming/project/runtime/logs/ nginx_general_error.log; pid /home/toinbis/Desktop/programming/project/runtime/var/pids/ nginx.pid; events { worker_connections 1024; #server_names_hash_bucket_size: 128; } http { include /home/toinbis/Desktop/programming/project/runtime/ etc/nginx_conf/mime.types; default_type application/octet-stream; access_log /home/toinbis/Desktop/programming/project/runtime/logs/ nginx_access.log; error_log /home/toinbis/Desktop/programming/project/runtime/logs/ nginx_error.log; sendfile on; tcp_nopush on; #keepalive_timeout 0; keepalive_timeout 2; tcp_nodelay on; server_names_hash_bucket_size 128; #server_name_hashes 128; gzip on; gzip_comp_level 2; gzip_proxied any; gzip_disable "MSIE [1-6]\.(?!.*SV1)"; #iš ubuntu gzip_types text/plain text/css application/x-javascript text/xml application/xml application/xml+rss text/javascript; upstream backend { server 127.0.0.1:8001; } server { listen 8003; server_name localhost; error_log /home/toinbis/Desktop/programming/project/ runtime/logs/project_nginx_error.log; access_log /home/toinbis/Desktop/programming/project/ runtime/logs/project_nginx_access.log; location / { proxy_pass http://backend/; include /home/toinbis/Desktop/programming/ project/runtime/etc/nginx_conf/nginx_proxy_1.conf; } location /media/ { root /home/toinbis/Desktop/programming/project/ src/tsd/core/; } } } cheers, to -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.