I am trying to check if the email identifier entered by the user in the database table exists, if it exists, I would like to send the template "prof.html", otherwise I will simply display the message in the login.html template.
Both conditions work fine.
However, the problem is that I use redirect () or render_to_response () - the elements of the destination template, such as div, input, etc., are automatically changed (prof.html in this case)?
Can I also send contextual information to the destination template? (response data or any object from the database and redirect to the prof.html template through the presentation in this case)
Below is my code:
Views.py
def verifyme(request): if request.method == "POST": emailid4loginV = request.POST['emailid4login_Aj'] else: emailid4loginV = '' response_data = '' return HttpResponse(response_data, content_type="text/plain") response_data = '' if Employee.objects.filter(email = emailid4loginV).exists(): response_data='Thanks for waiting - login successful'
urls.py
url(r'^myprofile$', 'app.views.profile', name='profile'),
For your information only, viewing a profile allows you to return some objects from a table and display them in the app / prof.html template.
I noticed that the destination template is displayed in the same login.html template (like ?: in the browser url, I do not see myprofile - but the one that is needed to enter the system). But when I request myprofile manually by typing url into the website (localhost: xxxxx / myprofile), it works fine: (
URL before submitting a request in login.html:

URL after sending the request to login.html - myprofile is displayed on the same page:

When I manually type url, the template works fine. 
Could you tell me what could be the problem?
EDIT: Solved this problem with a little trick posted in below
https://stackoverflow.com/questions/31091938/why-is-httpresponserederedrereverse-doesnt-redirect-to-new-page