Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

read api from django

from django.shortcuts import render
import requests

def github(request):
    user = {}
    if 'username' in request.GET:
        username = request.GET['username']
        url = 'https://api.github.com/users/%s' % username
        response = requests.get(url)
        user = response.json()
    return render(request, 'core/github.html', {'user': user})
Comment

PREVIOUS NEXT
Code Example
Python :: table in sqlite python 
Python :: python how to get data from dictionary 
Python :: how to convert float to string in python 
Python :: cite pandas python 
Python :: adfuller test in python 
Python :: numpy ndarray to matrix 
Python :: List comprehension if-else 
Python :: run all python files in a directory in bash 
Python :: axios django post 
Python :: array sort python 
Python :: binary to octal in python 
Python :: Python create a new png file 
Python :: flask run 
Python :: Login script using Python and SQLite 
Python :: python __lt__ 
Python :: send dm to user discord.py 
Python :: how to print during multiprocessing 
Python :: urllib.error.HTTPError: HTTP Error 404: Not Found 
Python :: python get file line count 
Python :: decimal to binary python 
Python :: logical operators python 
Python :: python palindrome check 
Python :: import module python same directory 
Python :: list all files in python 
Python :: get webpage python 
Python :: pandas create average per group 
Python :: django render example 
Python :: first and last name generator python 
Python :: from django.core.management import execute_from_command_line ImportError: No module named django.core.management 
Python :: dataframe python 
ADD CONTENT
Topic
Content
Source link
Name
4+7 =