Skip to content

Instantly share code, notes, and snippets.

View Riyas3's full-sized avatar

Riyasutheen Abdul Rahman Riyas3

View GitHub Profile
@Riyas3
Riyas3 / deploying_simple_api.md
Created October 23, 2019 11:23 — forked from prodeveloper/deploying_simple_api.md
Deploying your RESTful API to heroku

In this session, we are going to mimic a posts api that we worked on in a previous class. Typecode provides the free sample api.

APIs are what enable the backend, frontend and your mobile application to work together. We have also seen how to build basic REST api using Django Rest Framework

To get the post API to work we will need to work on four modules:

#models.py
from django.db import models
class Reporter(models.Model):
full_name = models.CharField(max_length=70)
def __str__(self):
return self.full_name
@Riyas3
Riyas3 / diff_of_scrapy_Compose_and_MapCompse.py
Created September 23, 2019 08:02 — forked from crazygit/diff_of_scrapy_Compose_and_MapCompse.py
The difference of scrapy built in loader processor Compose and MapComose
from scrapy.loader.processors import Compose, MapCompose
proc = Compose(lambda v: v[0], str.upper)
proc(['hello', 'world']) # HELLO
mproc = MapCompose(lambda v: v[0], str.upper)
mproc(['hello', 'world']) # ['H', 'W']