0
{% url 'start' commission.id applie.id %}

Like the above code, I am trying to send two model id but I don't know the right structure for it. and above code wouldn't work.

path('start/<int:post_id>', views.start, name="start"),

def start(request,post_id):

and also if i get two parenthesis, how should i modify the above url and view code?

1

1 Answer 1

1

Try to go with this way..

In urls.py--

path('profile/<name> <email>', views.profile, name='profile'),
#As path have space, it will take %20 there, 
#you can change it accordingly. best to use '-' instead of space
#http://example.com/profile/myname%[email protected]

In the link--

href="{% url 'profile' name='myname' email='[email protected]' %}"

In the views.py--

@login_required(login_url="login")
def profile(request, name, email):
   return render(request, "profile.html", {'name': name, 'email':email})
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.