Student:
- Vaibhav Gupta (dojutsu-user)
Student:
import os | |
import json | |
PATH_TO_OUTPUT_FILE = os.path.join('.', 'Dataset', '2009-2015.json') | |
def main(): | |
final_dict = {} | |
year_with_link = get_year_with_link() | |
def get_org_projects_info(org_link): | |
"""Get organisation's projects information | |
:param org_link: Valid link to the organisation's info page of a specific year | |
:type org_link: str | |
:returns: A list of dictionaries of each project's title, descrition and link of project | |
:rtype: list | |
""" | |
response = get_response(org_link) | |
if response.ok: |
def get_organizations_list_with_links(year_link): | |
"""Get all organisations and their links | |
:param year_link: Valid link to the list of organisations of a specific year | |
:type year_link: str | |
:returns: A dictionary with the names of the organisations as keys and their links as values | |
:rtype: dict | |
""" | |
response = get_response(year_link) | |
if response.ok: |
import os | |
import sys | |
import requests | |
from requests.exceptions import ConnectionError | |
from bs4 import BeautifulSoup | |
from utils import get_response | |
import requests | |
from requests.exceptions import ConnectionError | |
def get_response(link): | |
"""Make a GET request to the link | |
:param link: Valid HTTP/HTTPS link | |
:type link: str | |
:returns A response object | |
:rtype: requests.models.Response |
django-cors-headers
: pipenv install django-cors-headers
settings.py
corsheaders
to your INSTALLED_APPSMIDDLEWARE = [
'corsheaders.middleware.CorsMiddleware', # new
'django.middleware.common.CommonMiddleware', # new
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',