WebFaction
Community site: login faq

Hi everyone,

I have a Django site in production running Django 1.2.5 using Python 2.7/mod_wsgi 3.3. For the most part everything works great, but it seems that the site is throwing errors totally at random. They all end in the form:

TemplateDoesNotExist: xxx

These templates definitely do exist, and when I type in the URL that caused the exception the URL always seems to work. However, once in approximately every 150 page views, this error is thrown.

Do you have any ideas what could be causing it or where I should begin looking?

asked 18 Mar '11, 18:42

Spike
3335
accept rate: 0%

Hi,

I've not seen this happen frequently. Have you turned DEBUG on and tried viewing the site and generating a number of requests to see what happens?

(18 Mar '11, 18:56) klynton

Hmmm... I haven't tried doing that on the production server and am scared to do it because I don't want my guests seeing the output. I've never had this issue on my dev server, probably because on that server I just serve the media statically.

I searched a bit and found this link: http://leequerv.blogspot.com/2009/11/re-settingspy-seems-to-be-cached-or_24.html

Do you think I just need to reconfigure mod_wsgi? I've never really touched any of that outside of the webfaction django documentation.

(18 Mar '11, 20:52) Spike

Spike - did you ever get to the bottom on why you were getting these errors?

(21 Aug '11, 23:06) rosendo

Hey rosendo. Sorry for not posting my solution. I did get to the bottom of this, and it was because I had added some subdomain middlware that was swapping the django template directories depending on which subdomain was being used. The swapping was happening in settings.py and after I removed this and had a single static reference to all of the template directories it solved my problem.

(21 Aug '11, 23:12) Spike

Spike - I've been working on a development project and I've been plagued by random TemplateDoesNotExist errors - so I thought. After working with the folks here at Webfaction, it may turn out that my issue is related to having my templates loaded into Vim, writing out the file with :w on the webfaction server and then reloading the page on my web browser at my home office - some sort of race condition we think. What I'm trying now is using :w! whenever I save a file on the webfaction server. I just started this approach last night, stay tuned...

(28 Aug '11, 14:20) rosendo

Cool, I hope that works for you and look forward to hearing the results.

(28 Aug '11, 16:07) Spike
showing 5 of 6 show 1 more comments

I realize it's a long time since I asked this, but I thought I'd post a link to where I solved this:

http://stackoverflow.com/questions/5363297/random-django-templatedoesnotexist-errors

permanent link

answered 21 Aug '11, 23:10

Spike
3335
accept rate: 0%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×909
×337
×108

question asked: 18 Mar '11, 18:42

question was seen: 5,451 times

last updated: 28 Aug '11, 16:07

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM