Dynamic content in the database
Hi all, I was wondering if anyone had any suggestions on how to approach what I imagine is a fairly common issue. Say for example I'm developing a blog app (just to reinvent the wheel again). In my blog posts I want to link to something else on my site. Normally I would use reverse (or {% url ... %} in a template) to avoid hard coding urls. If I'm saving my post to the database though, theres no way to do this. The best solution I can come up with is to invent a new markup for internal urls and write a template filter that will perform the reverse lookups for me and replace my markup with html. I'd be interested to hear if anyone else has done this sort of thing, maybe not just with urls but anything else that might change. Cheers, Pete --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@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 -~--~~~~--~~--~--~---
Really slow performance on webfaction
Hi all, I'm trying to figure out possible causes for really slow performance of my site on my production server on webfaction - it can take up to 15s to load! It only seems to be a problem on the home page of my site and it also doesn't seem to be anything like too many queries. Using the debug toolbar, I got the following information: User CPU time 1060.838 msec System CPU time 97.985 msec Total CPU time 1158.823 msec Elapsed time13099.062 msec It also tells me that the cache has been hit, meaning only a few DB hits. On my test server it loads very quickly on a cache hit. Obviously from this information no one is going to solve the problem, but if you can help me by suggesting where to look or how to get some more useful profiling information on a production server that would be great. Cheers, Pete -- 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.
Broken link emails
Hi all, I recently turned on the broken link emails setting on my site, and I've got a couple that really confused me. I assume these emails get sent to me when a user gets a 404, and the referrer is internal. But here is one example I got: Referrer: http://www.example.com/photos/gallery/singapore-malaysia-and-thailand/wat-phra-mahathat-3/ Requested URL: /photos/gallery/singapore-malaysia-and-thailand/wat-phra-mahathat-3/#submitted User agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) IP address: 127.0.0.1 As far as I can tell, the URL is identical to the referrer (which is a valid page), except the anchor, which I thought the server doesn't care about (I didn't even think the server got sent the anchor?) On that page, the reference to that address is in a forms submit target - the idea being that users will be taken straight back to the form if validation fails, rather than the top of the page. Could this be an IE bug (all the emails have had that user agent) that is handling the forms target incorrectly, or is that just not something you're supposed to do? On a slightly related note, could any webfaction customers (or anyone else) shed any light on how I would stop all of requests from appearing to be internal? Notice the IP address there - I guess it's because of the webfaction set up of nginx proxying for apache. Anyone know any config changes I can make? All my comments have that as the users IP too, which isn't ideal. Any light you could shed on this would be great! Peter -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@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.