Quantcast
Channel: Active questions tagged html - Stack Overflow
Viewing all articles
Browse latest Browse all 74045

not sure what to put in action attribute in form

$
0
0

This code is for my signup page as you can see action is set for signup


{% block content %}

<form class="form-horizontal" action="signup" method="post">
    {% csrf_token %}
    {{ form }}
    <br />
    <input type="submit" value="Sign up" class="btn btn-default" />
</form>

{% endblock %}

This is my views.py in the same app

def signup(request):
    if request.method == 'POST':
        form = UserCreationForm(request.POST)
        if form.is_valid():
             form.save()
             return redirect('app:home')
            # log the user in
    else:
        form = UserCreationForm()
    return render(request, 'accounts/signup.html', {'form': form})

This is my url for which doesn't work

path('signup/', accounts_views.signup, name='signup')

Viewing all articles
Browse latest Browse all 74045

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>