Need more info. The full traceback on a TemplateSyntaxError often includes the initial error that is really the problem. Add the full entire traceback, and your admin.py file.
–
Carl MeyerJan 18 '10 at 17:39

I assume this admin.py file caused the issue as it is the only one I have edited since it worked. from django.contrib import admin from pest.error_logging.models import Error admin.site.register(Error)
–
danpalmerJan 18 '10 at 17:50

2 Answers
2

It may be a missing import, or even a typo, but it's hard to tell without any code. It would be great if you could post your admin.py file so we can take a look.

TemplateSyntaxErrors in Django are terrible, they almost never tell you what the real problem is. In this case, for example, the template is part of Django, but the error is probably something in your admin file, which Django reads to create the admin interface. The traceback is too deep to find out right away where in your code the problem is.

Thank you, I will check all the admin.py files that I have in the project. It must be something I have done as I haven't edited the Django installation at all and it was working until today. Unfortunately, I have written 600 lines today and don't know at what point it went wrong.
–
danpalmerJan 18 '10 at 17:34

@danpalmer If you are using any SCM, you can go back in time and see when you broke it, than just figure out what was the difference. Anyway, as I said, it's most likely a typo or an import error.
–
Flávio AmieiroJan 18 '10 at 17:42

It fails on this line in the template: {% url django-admindocs-docroot as docsroot %} The admin.py file (the one I have added since it last worked) is really basic though: from django.contrib import admin from pest.error_logging.models import Error admin.site.register(Error)
–
danpalmerJan 18 '10 at 17:44

@flavio-amieiro I am using subversion, but not as well as I should be and I think it was part of a massive commit where I added an entire new app to the project :(
–
danpalmerJan 18 '10 at 17:46

@flavio-amieiro Also, there are 28 items in the traceback and all are in the Django code, not in my own.
–
danpalmerJan 18 '10 at 17:48

It turns out it was a rather simple thing, I am just not experienced enough with Python and I was calling on my .NET experience. Bad mistake.

I called project.settings.SETTING where I should have imported project.settings and then accessed settings.SETTING.

In .NET the imports act just shortcuts so you don't have to type the whole 'path' to the function or setting, whereas in Python it seems that you must have the things you are using imported.

I don't know if that makes any sense, or if it even correct, but it now works. Thanks for everyone's help, you are always a great help and I wouldn't be able to do this development and advance my knowledge without the resources here.