Django admin can't display user detail view: 500 error

239 views
Skip to first unread message

amarshall

unread,
Aug 28, 2014, 8:22:00 PM8/28/14
to django...@googlegroups.com
I've deployed my django application using Nginx and uWSGI.

In development I can login to my django admin-> users-> [username] and it shows the users information. However in development once I click on a user I get a "server 500" error. I have the same code for both deployment and development. I can't think of what the problem could be ?

Babatunde Akinyanmi

unread,
Aug 29, 2014, 1:31:11 AM8/29/14
to django...@googlegroups.com

Hi Amarshall?
We need more information. Give us the traceback

On 29 Aug 2014 01:22, "amarshall" <adria...@gmail.com> wrote:
I've deployed my django application using Nginx and uWSGI.

In development I can login to my django admin-> users-> [username] and it shows the users information. However in development once I click on a user I get a "server 500" error. I have the same code for both deployment and development. I can't think of what the problem could be ?

--
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...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/176e31ad-5b35-429b-ad61-33753bcd30c4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Collin Anderson

unread,
Aug 29, 2014, 10:39:00 AM8/29/14
to django...@googlegroups.com
is your ALLOWED_HOSTS set correctly?

it's also possible to set up  ADMINS and email settings so you get an email with details about the server 500 error.

Does your uWSGI log show any more info?

amarshall

unread,
Aug 29, 2014, 11:59:11 AM8/29/14
to django...@googlegroups.com
I'm pretty sure my ALLOWED_HOST is setup right to allow all url locations after the main domain. I have not setup the EMAIL to send me notifications upon 500 server error. Will do now. About to check my uwsgi log and post it as well

amarshall

unread,
Aug 29, 2014, 4:00:51 PM8/29/14
to django...@googlegroups.com
I didn't have my uwsgi setup to log. So I did with this command :

uwsgi --socket :8001 --wsgi-file wsgi.py --master --processes 5 --threads 2 --daemonize /var/log/uwsgi/lokalapp.log


So I went to the site to reach the 500 error to see if anything updates and nothing is updated in the log file when I check it.

This is the only thing it logs:

*** Starting uWSGI 2.0.6 (64bit) on [Fri Aug 29 15:43:09 2014] ***
compiled
with version: 4.8.2 on 24 July 2014 15:50:13
os
: Linux-3.13.0-24-generic #46-Ubuntu SMP Thu Apr 10 19:11:08 UTC 2014
nodename
: web01
machine
: x86_64
clock source
: unix
detected number of CPU cores
: 2
current working directory
: /var/www/lokalapp.co
detected binary path
: /usr/local/bin/uwsgi
!!! no internal routing support, rebuild with pcre support !!!
uWSGI running
as root, you can use --uid/--gid/--chroot options
*** WARNING: you are running uWSGI as root !!! (use the --uid flag) ***
your processes number limit
is 15802
your memory page size
is 4096 bytes
detected max file descriptor number
: 1024
lock engine: pthread robust mutexes
thunder
lock: disabled (you can enable it with --thunder-lock)
probably another instance of uWSGI
is running on the same address (:8001).
bind
(): Address already in use [core/socket.c line 759]
*** Starting uWSGI 2.0.6 (64bit) on [Fri Aug 29 15:45:57 2014] ***
compiled
with version: 4.8.2 on 24 July 2014 15:50:13
os
: Linux-3.13.0-24-generic #46-Ubuntu SMP Thu Apr 10 19:11:08 UTC 2014
nodename
: web01
machine
: x86_64
clock source
: unix
detected number of CPU cores
: 2
current working directory
: /var/www/lokalapp.co
detected binary path
: /usr/local/bin/uwsgi
!!! no internal routing support, rebuild with pcre support !!!
uWSGI running
as root, you can use --uid/--gid/--chroot options
*** WARNING: you are running uWSGI as root !!! (use the --uid flag) ***
your processes number limit
is 15802
your memory page size
is 4096 bytes
detected max file descriptor number
: 1024
lock engine: pthread robust mutexes
thunder
lock: disabled (you can enable it with --thunder-lock)
probably another instance of uWSGI
is running on the same address (:8001).
bind
(): Address already in use [core/socket.c line 759]


So, it doesn't show anything. Also, at first I was running that command without the --daemonize tag. Since I have I can't kill the server to restart it. Wanted to try to kill it with "kill -9 [process id] " but when I do another process comes in it's place.

amarshall

unread,
Aug 29, 2014, 4:44:48 PM8/29/14
to django...@googlegroups.com
I see now that I think the best course of action is to get the traceback by adding the ADMINS settings. So I did that. Now I need to restart the uwsgi server process. Any suggestions on how to kind of brute force do that right now?

I see on their site they suggest "uwsgi --reload /tmp/project-master.pid". I see this everywhere but no where has any site/tut said "create a project-master.pid file for ________ reasons".  I'm assuming it's supposed to contain a list of all the uwsgi worker processes? I created a blank file at that directory and tried to run my command to start the service over again adding the "pidfile=/tmp/project-master.pid" tag and I go to check the file and nothing is there. So I'm not sure if the uwsgi command is restarting . All so I can see and get my traceback.. Sorry about this tanget.

amarshall

unread,
Aug 30, 2014, 6:01:21 PM8/30/14
to django...@googlegroups.com
Okay, I got everything working. I was totally over thinking things I think. I added the ADMINS variable in my settings to get a traceback and it seems a package(django-tastypie) I installed on my development side I forgot to install on the production side. Once I installed it, I migrated it's new tables using South and everything worked.


On Thursday, August 28, 2014 8:22:00 PM UTC-4, amarshall wrote:
Reply all
Reply to author
Forward
0 new messages