[Fixed]-How to give an internal link to a submit button in django?

1👍

Why don’t you use redirect in your views.py? Unless the link is dynamic, you should be able to easily achieve this in your views:

from django.shortcuts import redirect
from django.core.urlresolvers import reverse

def index(request):
    if request.method == 'POST':
        form = scrapform(request.POST)

        if form.is_valid():
            # you don't actually need commit=True, that's the default behavior
            form.save()
            return redirect(reverse('url-for-content.html'))

Django doc for redirect and reverse.

Leave a comment