2

When I attempt to access particular pages of my application on the django development server, the server suddenly quits with no error message, leaving the browser with a "Error 324 (net::ERR_EMPTY_RESPONSE)"

What kind of thing could I have done in the code that would cause the development server to suddenly quit with no error messages?

The GET request that triggers the server to quit is not logged. For example, after starting the server and attempting a GET of one of the problem pages, my command line looks like this:

(mysite)01:25 PM benjamin ~/projects/mysite $ runserver
Validating models...

0 errors found
Django version 1.3.1, using settings 'mysite.settings'
Development server is running at http://127.0.0.1:8000/
Quit the server with CONTROL-C.
(mysite)01:28 PM benjamin ~/projects/mysite $

I'm running django 1.3.3 in a virtualenv using Python 2.6

BenjaminGolder
  • 1,573
  • 5
  • 19
  • 37

2 Answers2

1

I found this because I was encountering a similar problem. It turned out I was running out of memory. Figured I would mention it on the off chance that it helps someone.

N7L
  • 109
  • 1
  • 3
1

The bus error can happen when you're trying to extend a template with another template that has the same filename and relative path.

Example

Let's say you want to use your own poll.html template for the voting app, but to reuse as much as possible, you extend from the original poll.html:

<!-- myapp/templates/voting/poll.html -->
{% extends 'voting/poll.html' %}
<!-- Trying to extend from 'voting/templates/voting/poll.html' -->
...

This will give you the bus error, because the template is extending "itself", even though that's not what you're trying to do.

Your own voting/poll.html is shadowing the original poll.html from the voting app, which will never be found

myproject/myapp/templates/voting/poll.html
myproject/voting/templates/voting/poll.html <-- you cannot extend from this

I haven't found a general solution to this, but I ran into the problem trying to customize the admin app's index.html and for that there is a solution (See below).

Customizing the "admin" app

I got the "bus error" when trying to customize the index.html in the admin app, and extending from the original admin/index.html. The solution to that specific problem is described here: How to override and extend basic Django admin templates? – you name your own admin/index.html something else, in order to extend from the original admin/index.html

Community
  • 1
  • 1
qff
  • 5,524
  • 3
  • 37
  • 62
  • See also: http://stackoverflow.com/questions/11900187/django-template-inheritance-causes-a-bus-error – qff Oct 01 '14 at 13:50