please explain ?

On Friday, July 5, 2019 at 7:25:08 AM UTC+2, Serdar Emirci wrote:
>
>
>  <str:*code*>/League > <str:*core*>/League
>  
>  
> Serdar EMIRCI
>
>
> omar ahmed <omark...@gmail.com <javascript:>>, 5 Tem 2019 Cum, 00:43 
> tarihinde şunu yazdı:
>
>> hiii ..
>> i use REST api to get data from "https://www.football-data.org"; ..
>> i want to create one view that can restore any league (by league code 
>> like: PL for premier league) not for particular league
>> openleague.html
>> {% block content %}
>> <ul>
>> <li><a href="{% url 'core:openleague' PL %}">Premier League</a></li>
>> <li><a href="{% url 'core:openleague' PD %}">Spanish League</a></li>
>> <li><a href="{% url 'core:openleague' SA %}">Italian League</a></li>
>> <li><a href="{% url 'core:openleague' BL1 %}">German League</a></li>
>> <li><a href="{% url 'core:openleague' FL1 %}">French League</a></li>
>> </ul>
>> {% endblock %}
>> urls.py
>> urlpatterns =[
>> path('', views.home,name='home'),
>> path('<str:code>/League', views.openleague, name='openleague'),
>> ]
>> views.py
>> def openleague(request,code):
>> connection = http.client.HTTPConnection('api.football-data.org')
>> headers = { 'X-Auth-Token': '##################' }
>> connection.request('GET', '/v2/competitions/{'code'}', None, headers)
>> response = json.loads(connection.getresponse().read().decode())
>>
>> return render(request, 'core/openleague.html', {'response': response})
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django...@googlegroups.com <javascript:>.
>> To post to this group, send email to django...@googlegroups.com 
>> <javascript:>.
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/88b03928-dbbb-4b66-8661-499bdade3381%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/django-users/88b03928-dbbb-4b66-8661-499bdade3381%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/23ccee4d-a0a3-4ede-9036-5cf74bafc4b0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to