Tipan wrote:
> def codeview(request):
> manipulator = CodeViewManipulator()
> if request.method == 'POST':
> new_data = request.POST.copy()
> errors = manipulator.get_validation_errors(new_data)
> if not errors:
> <code to create data>
> return HttpResponseRedirect("/hive/codeoutput/")
> else:
> errors = new_data = {}
> code_list=CodeTest.objects.all()
> return render_to_response('codeview.html', {'code_list':code_list})
>
> This always generates a Django Syntax Error on the return
> render_to_response line. I can define a new view with just the last two
> lines and it works fine. The function also runs if I substitute a
> return HttpResponse line instead of the render_to_response, but then it
> won't display my html template page.
>
> Is there some ruling preventing me from using render_to_response in
> this way?
>
> Any advice welcome - it's driving me crazy!Could it be a case of tab vs. spaces indentation? What more that Syntax Error does the django error page tell you? -- Christian Joergensen | Linux, programming or web consultancy http://www.razor.dk | Visit us at: http://www.gmta.info
signature.asc
Description: OpenPGP digital signature

