[Solved] I have python syntax error in django project

[ad_1] You are making mistake here user = User.objects.create_user{ username=request.POST[“username”], password = request.POST[“password”] Try this user = User.objects.create_user(username=request.POST[“username”],password = request.POST[“password”]) 2 [ad_2] solved I have python syntax error in django project

[Solved] Django, how do it in template?

[ad_1] # Something along the lines of this. rate = Rate.objects.get(user=request.user) context = {…., “user”: request.user, “rate”: rate} return render(request, ‘template.html’, context=context) In your template: {% if rate %} <h2><a href=”https://stackoverflow.com/games/{{game.id}}/{{game.slug}}/add_rate/edit/{{rate.id}}/”>Edit rate</a></h2> {% else %} <h2><a href=”http://stackoverflow.com/games/{{game.id}}/{{game.slug}}/add_rate”>Add rate</a></h2> {% endif %} 6 [ad_2] solved Django, how do it in template?