Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7009057
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T21:48:51+00:00 2026-05-27T21:48:51+00:00

Getting started with Django 1.3 here. Loving the system so far, but struggling on

  • 0

Getting started with Django 1.3 here. Loving the system so far, but struggling on stuff. Also loving stackoverflow for the Q&As. 🙂

I’m currently working on getting logins & registrations working and I’m getting a TemplateSyntaxError with my login view.

Template error

In template /templates/login.html, error at line 9
Caught SyntaxError while rendering: (‘invalid syntax’, (‘/userProfile/views.py’, 47, 52, “\t\treturn render_to_response(‘login.html’, {‘form’: })\n”))

I’ve copy-pasted the code from Django’s auth documentation for a login view:

{% extends "base.html" %}
{% load url from future %}

{% block body-content %}

{% if form.errors %}
<p>Your username and password didn't match. Please try again.</p>
{% endif %}

<form method="post" action="{% url django.contrib.auth.views.login %}">
{% csrf_token %}
<table>
<tr>
    <td>{{ form.username.label_tag }}</td>
    <td>{{ form.username }}</td>
</tr>
<tr>
    <td>{{ form.password.label_tag }}</td>
    <td>{{ form.password }}</td>
</tr>
</table>

<input type="submit" value="login" />
<input type="hidden" name="next" value="{{ next }}" />
</form>

{% endblock %}

Django is breaking on the following line –

<form method="post" action="{% url 'django.contrib.auth.views.login' %}">

I’ve tried removing the single quotes, adding quotes, removing the future url loading but nothing seems to be working. I’ve read the NoReverseMatch question but it doesn’t seem to apply.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T21:48:52+00:00Added an answer on May 27, 2026 at 9:48 pm

    The problem is not in your template but rather in your views.py file, line 47:

    return render_to_response('login.html', {'form': })
    

    The render_to_response function expects a template name (here: login.html) and a dictionary (here: {'form': }). However, your dictionary contains a syntax error: You have provided a key (form) but are missing a value.

    The correct syntax should be something like:

    return return render_to_response('login.html', {'form': my_form})
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Just getting started with C++ here. I am working on OSX with Eclipse CDT.
Just getting started with Android development and Java. So, here's the code I'm working
As far as I understand, the Getting Started guide of GAE with Python uses
Just getting started with jQuery, and I've had some success so far. I've created
I'm getting started with django and I'd like to extend the basic django.contrib.auth.models.User class
I am getting started with django-cms and I am facing an exception when I
I am new to Django and have started working on a mature Django project.
I am running django on django's development server. It was working fine before but
I am currently working an a webapp, using mongoengine and django, which will require
I'm getting started with developing Django code on a server, running on top of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.