I am a beginner and do not know how to send all the necessary parameters to the page I want to open. There is a page with url sklad . To open the sklad page, it needs to pass all the necessary parameters to the GET request (which parameters need to be sent, I don’t know for sure, but there is the code for the page sklad ).

This starts the sklad page:

 <button type="button" onclick="window.open('{% url 'sklad' %}', '_blank')"> Расписание </button> 

sklad = "/gorod/sklad"

How to view the parameters that are sent by my GET request, if the page cannot be launched due to unsuitable parameters passed by a GET request? Please describe in as much detail as possible without using php.

I use Django 1.6

  • The required parameters should usually be visible in the description of the desired view. - jumpman24

2 answers 2

In janga, there is no need to pass parameters to get. In jang, the necessary variables can be included in the address bar, which can be parsed in the url configuration.

Here is the documentation on how to do it: http://djbook.ru/rel1.9/topics/http/urls.html

If you still need the get method, it looks like this:

 http://some-site.ru?var1=value&var2=value2" 
  • Thank you, this is what you need! But in my question I didn’t initially indicate the version of Django (now added), so in my case djbook.ru/rel1.6/intro/tutorial03.html is more suitable - EmptyMan

GET parameters are very simple:

 {% url 'sklad' %}?key=value 

If you mean the parameters from the path that you specified when registering the route:

 url(r'^sklad/(?P<sklad_id>[0-9]+)$', 'apps.panel.views.sklad', name='sklad') 

Such parameters are passed to the url function:

 {% url 'sklad' sklad_id=row_id %}