<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Revanth Reddy</title>
    <description>The latest articles on Forem by Revanth Reddy (@revanthreddy).</description>
    <link>https://forem.com/revanthreddy</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F391538%2F5a38ff36-c118-4e93-954d-b083399843ec.jpeg</url>
      <title>Forem: Revanth Reddy</title>
      <link>https://forem.com/revanthreddy</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/revanthreddy"/>
    <language>en</language>
    <item>
      <title>TAMU DATATHON</title>
      <dc:creator>Revanth Reddy</dc:creator>
      <pubDate>Sun, 17 Oct 2021 13:51:19 +0000</pubDate>
      <link>https://forem.com/revanthreddy/tamu-datathon-2eea</link>
      <guid>https://forem.com/revanthreddy/tamu-datathon-2eea</guid>
      <description>&lt;h1&gt;
  
  
  DaHack - Hackathons Dataset!
&lt;/h1&gt;

&lt;p&gt;GitHub Link: &lt;a href="https://github.com/revanth-reddy/tamudatathon"&gt;https://github.com/revanth-reddy/tamudatathon&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Hackathon's Dataset in Hackathon&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--XS9bNE11--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://img.shields.io/badge/Python-FFD43B%3Fstyle%3Dfor-the-badge%26logo%3Dpython%26logoColor%3Ddarkgreen" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--XS9bNE11--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://img.shields.io/badge/Python-FFD43B%3Fstyle%3Dfor-the-badge%26logo%3Dpython%26logoColor%3Ddarkgreen" alt="Python"&gt;&lt;/a&gt; &lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--g8N419jY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://img.shields.io/badge/Selenium-43B02A%3Fstyle%3Dfor-the-badge%26logo%3DSelenium%26logoColor%3Dwhite" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--g8N419jY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://img.shields.io/badge/Selenium-43B02A%3Fstyle%3Dfor-the-badge%26logo%3DSelenium%26logoColor%3Dwhite" alt="enter image description here"&gt;&lt;/a&gt; &lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--1lc__bQY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://img.shields.io/badge/Colab-F9AB00%3Fstyle%3Dfor-the-badge%26logo%3Dgooglecolab%26color%3D525252" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--1lc__bQY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://img.shields.io/badge/Colab-F9AB00%3Fstyle%3Dfor-the-badge%26logo%3Dgooglecolab%26color%3D525252" alt="enter image description here"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://colab.research.google.com/github/revanth-reddy/tamudatathon/"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--cw8uDh-t--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;This &lt;a href="https://github.com/revanth-reddy/tamudatathon/blob/master/hackathons_data.csv"&gt;Dataset&lt;/a&gt; is built as a part of TAMU Datathon 2021. It contains the details of hackathons which include Title, Location, Start Date, End Date, Prize Money, Number of Participants, Host of Hackathon, Themes in the Hackathon&lt;/p&gt;

&lt;p&gt;As a part of &lt;a href="https://tamudatathon.com/"&gt;Tamu Datathon 2021&lt;/a&gt; challenges, we chose &lt;a href="https://tamudatathon.com/challenges/docs/td_challenge"&gt;TD Data Synthesis Challenge&lt;/a&gt;. We approached the problem of synthesis of Hackathons Dataset throughout the world.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Construction of Dataset
&lt;/h2&gt;

&lt;p&gt;The data for this dataset is obtained by Web Scraping using Python and Selenium.&lt;/p&gt;

&lt;h2&gt;
  
  
  Size
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;We are able to generate a dataset of 6,236 hackathons due to time constraints. However this size can be tremendously increased.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Uniqueness
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;This is the first Hackathon's Dataset with 8 unique features that are the major datapoints of a Hackathon&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Usefulness
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;To Observe the trends:

&lt;ul&gt;
&lt;li&gt;Number of Hackathons per year.&lt;/li&gt;
&lt;li&gt;Hackathons Prize Money Trend over years.&lt;/li&gt;
&lt;li&gt;Rise of Themes through the years.&lt;/li&gt;
&lt;li&gt;Participation in the Hackathon across years/themes.&lt;/li&gt;
&lt;li&gt;And many more ...&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;To Build ML models in order :

&lt;ul&gt;
&lt;li&gt;to predict Prize Money based on other features like participation, themes, location.&lt;/li&gt;
&lt;li&gt;to estimate user participation based on location, prize money, themes, etc.&lt;/li&gt;
&lt;li&gt;to analyze relationship between the above features.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Visualization
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Interactive Visualization: &lt;a href="https://datastudio.google.com/reporting/269afbc3-e982-4fef-aee5-08010b427070"&gt;https://datastudio.google.com/reporting/269afbc3-e982-4fef-aee5-08010b427070&lt;/a&gt; (Open to interactive with visualization playground)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;User Interactive graphs and charts to analyze the hackathon's dataset&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--apWtEEFf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/revanth-reddy/tamudatathon/master/images/visualization.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--apWtEEFf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/revanth-reddy/tamudatathon/master/images/visualization.png" alt="Visualization Image"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--4iIho1lu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/revanth-reddy/tamudatathon/master/images/graph-1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--4iIho1lu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/revanth-reddy/tamudatathon/master/images/graph-1.png" alt="Visualization Image"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--N9ahiVAw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/revanth-reddy/tamudatathon/master/images/graph-2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--N9ahiVAw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/revanth-reddy/tamudatathon/master/images/graph-2.png" alt="Visualization Image"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--oCEfQSdF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/revanth-reddy/tamudatathon/master/images/graph-3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--oCEfQSdF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/revanth-reddy/tamudatathon/master/images/graph-3.png" alt="Visualization Image"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Team's Approach
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;To build a dataset, we need to find a potential and authentic source, for which we used devpost as the source.&lt;/li&gt;
&lt;li&gt;To get the data from Website, we used Web Scraping tools which helps in getting the raw data&lt;/li&gt;
&lt;li&gt;We have used Selenium to scrape the website.&lt;/li&gt;
&lt;li&gt;We used a Chrome Web Driver to create the automation of scrolling and scraping the data.&lt;/li&gt;
&lt;li&gt;After Scraping, we got the raw data which is processed further and cleaned.&lt;/li&gt;
&lt;li&gt;The clean data is stored as a dataset in a CSV file.&lt;/li&gt;
&lt;li&gt;Unique datapoints like Number of participants, Start Date, End Date, Location(Online/Offline location), Prize Money, Themes&lt;/li&gt;
&lt;li&gt;After obtaining a decent dataset, we used Google Studio to provide insights of the dataset and relations between the variables in the dataset.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Reflection
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;### Problems

&lt;ul&gt;
&lt;li&gt;While scraping the website, the content inside website is not rendered as static content.&lt;/li&gt;
&lt;li&gt;As the content is dynamic one, it is hard to scrape.&lt;/li&gt;
&lt;li&gt;The website has a pagination effect based on page scrolling. So, initially &lt;code&gt;x&lt;/code&gt; items are loaded in the website and on scrolling another &lt;code&gt;x&lt;/code&gt; items are loaded and so on.&lt;/li&gt;
&lt;li&gt;Unless we scroll we can't scrape the entire dataset.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;### Future Scope

&lt;ul&gt;
&lt;li&gt;The Dataset can be used to build a Machine Learning Model (to help in picking a theme/prize money/participant estimation and also in analyzing the trends of Hackathons)&lt;/li&gt;
&lt;li&gt;Automation of Scraping using Job Schedulers(CI/CD) to scrape data periodically &lt;/li&gt;
&lt;li&gt;Large data can be scraped from various sources&lt;/li&gt;
&lt;li&gt;Scraping process can be further optimized by using mutlithreading.
## Team DaHack&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://github.com/pcarribean/"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--WjACAUOs--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://img.shields.io/badge/MANISHA-DEV-lightgray" alt="Site https://github.com/pcarribean/"&gt;&lt;/a&gt; &lt;a href="https://github.com/msharsha"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ayKhrhcz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://img.shields.io/badge/MSHARSHA-DEV-brightgreen" alt="Site https://github.com/msharsha/"&gt;&lt;/a&gt; &lt;a href="https://github.com/revanth-reddy/"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--nKXEBgCk--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://img.shields.io/badge/REVANTH-DEV-skyblue" alt="Site https://github.com/revanth-reddy/"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.linkedin.com/in/manisha-bachu/"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--bX1AJYT6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://img.shields.io/badge/-manisha--bachu-blue%3Fstyle%3Dflat-square%26logo%3DLinkedin%26logoColor%3Dwhite%26link%3Dhttps://www.linkedin.com/in/thaianebraga/" alt="Linkedin: manisha-bachu"&gt;&lt;/a&gt; &lt;a href="https://www.linkedin.com/in/msharsha/"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--VDj9HYXh--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://img.shields.io/badge/-msharsha-blue%3Fstyle%3Dflat-square%26logo%3DLinkedin%26logoColor%3Dwhite%26link%3Dhttps://www.linkedin.com/in/thaianebraga/" alt="Linkedin: msharsha"&gt;&lt;/a&gt; &lt;a href="https://www.linkedin.com/in/revanth--reddy/"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--cJBvaUV---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://img.shields.io/badge/-revanth--reddy-blue%3Fstyle%3Dflat-square%26logo%3DLinkedin%26logoColor%3Dwhite%26link%3Dhttps://www.linkedin.com/in/thaianebraga/" alt="Linkedin: revanth--reddy"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--sphWqDk3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/revanth-reddy/tamudatathon/master/images/team.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--sphWqDk3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/revanth-reddy/tamudatathon/master/images/team.png" alt="Team Image"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>python</category>
      <category>tamudatathon</category>
      <category>tamu</category>
      <category>hacktoberfest</category>
    </item>
    <item>
      <title>Build Notifications @ Slack using GitHub Notifications</title>
      <dc:creator>Revanth Reddy</dc:creator>
      <pubDate>Sat, 15 Aug 2020 15:46:44 +0000</pubDate>
      <link>https://forem.com/revanthreddy/build-notifications-slack-using-github-notifications-4p01</link>
      <guid>https://forem.com/revanthreddy/build-notifications-slack-using-github-notifications-4p01</guid>
      <description>&lt;p&gt;If you have a team and if there are many people in the team pushing to GitHub then it might be hard sometimes to check the build status of an active project. The slack notification GitHub action will notify the team regarding the build status.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Ok0591JX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/lmmbtovm1ap3lq2urrhg.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Ok0591JX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/lmmbtovm1ap3lq2urrhg.jpg" alt="Alt Text" width="880" height="466"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  My Workflow
&lt;/h3&gt;

&lt;p&gt;To enable the slack notifications, I searched for the marketplace for one such action and found this:&lt;/p&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--566lAguM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/github-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/act10ns"&gt;
        act10ns
      &lt;/a&gt; / &lt;a href="https://github.com/act10ns/slack"&gt;
        slack
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      Slack messages for GitHub Action workflows, jobs and steps
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;p&gt;&lt;a rel="noopener noreferrer" href="https://github.com/act10ns/slack/workflows/build-test/badge.svg"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--7wT8ndvR--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://github.com/act10ns/slack/workflows/build-test/badge.svg" alt="build-test"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h1&gt;
Slack messages for GitHub Actions workflows, jobs and steps&lt;/h1&gt;
&lt;p&gt;A simple and flexible Slack integration with GitHub Actions.&lt;/p&gt;
&lt;p&gt;&lt;a rel="noopener noreferrer" href="https://github.com/act10ns/slack./docs/images/example1.png"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--z2VIWePP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://github.com/act10ns/slack./docs/images/example1.png" width="540" title="Slack Example #1"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
Features&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Advanced users can use a &lt;a href="https://github.com/act10ns/slack#config-optional"&gt;configuration file&lt;/a&gt; and Handlebars templates to configure every aspect of the Slack message.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;In addition to "legacy" attachments, rich messages can be created using &lt;a href="https://api.slack.com/messaging/composing/layouts" rel="nofollow"&gt;layout blocks&lt;/a&gt; for flexible message visualisation and interactivity.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
Configuration&lt;/h2&gt;
&lt;h3&gt;
Environment Variables (&lt;code&gt;env&lt;/code&gt;)&lt;/h3&gt;
&lt;h4&gt;
&lt;code&gt;SLACK_WEBHOOK_URL&lt;/code&gt; (required)&lt;/h4&gt;
&lt;p&gt;Create a Slack Webhook URL using either the
&lt;a href="https://slack.com/apps/A0F7XDUAZ-incoming-webhooks?next_id=0" rel="nofollow"&gt;Incoming Webhooks App&lt;/a&gt;
(preferred) or by attaching an incoming webhook to an existing
&lt;a href="https://api.slack.com/apps" rel="nofollow"&gt;Slack App&lt;/a&gt; (beware, channel override not possible
when using a Slack App):&lt;/p&gt;
&lt;div class="snippet-clipboard-content position-relative overflow-auto"&gt;&lt;pre&gt;&lt;code&gt;env
  SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h3&gt;
Input Parameters (&lt;code&gt;with&lt;/code&gt;)&lt;/h3&gt;
&lt;h4&gt;
&lt;code&gt;status&lt;/code&gt; (required)&lt;/h4&gt;
&lt;p&gt;The &lt;code&gt;status&lt;/code&gt; must be defined. It can either be the current job status
using:&lt;/p&gt;
&lt;div class="snippet-clipboard-content position-relative overflow-auto"&gt;&lt;pre&gt;&lt;code&gt;  with: 
    status: ${{ job.status }}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;or a hardcoded custom status such as "starting" or "in progress":&lt;/p&gt;
&lt;div class="snippet-clipboard-content position-relative overflow-auto"&gt;&lt;pre&gt;&lt;code&gt;  with: 
    status: in progress
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h4&gt;
&lt;code&gt;steps&lt;/code&gt; (optional)&lt;/h4&gt;
&lt;p&gt;The individual status of job…&lt;/p&gt;
&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/act10ns/slack"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;I used this action in my django project by adding  some lines of code in &lt;code&gt;.github/workflows/django.yml&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;name: Django CI
on:
  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]
jobs:
  build:
    runs-on: ubuntu-latest
    strategy:
      max-parallel: 4
      matrix:
        python-version: [3.6]
    env:
      SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }}
    steps:
    - uses: act10ns/slack@v1
      with:
        status: starting
        channel: '#build-notifications'
      if: always()
    - name: Checkout
      uses: actions/checkout@v2
    - name: Set up Python ${{ matrix.python-version }}
      uses: actions/setup-python@v2
      with:
        python-version: ${{ matrix.python-version }}
    - name: Install Dependencies
      run: |
        python -m pip install --upgrade pip
        pip install -r requirements.txt
    - name: Run Tests
      run: |
        python manage.py test shop -v 2
    - name: Slack Notification
      uses: act10ns/slack@v1
      with:
        status: ${{ job.status }}
        steps: ${{ toJson(steps) }}
        channel: '#build-notifications'
      if: always()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;This is my &lt;code&gt;.yml&lt;/code&gt; workflow file. You can add these lines to your workflow file and get the job done.&lt;/p&gt;

&lt;p&gt;Observe that I have used &lt;code&gt;act10ns/slack@v1&lt;/code&gt; which is the github action responsible for all this.&lt;/p&gt;

&lt;p&gt;Here secret is similar to an environment variable that can be added by going to &lt;code&gt;settings &amp;gt; secrets &amp;gt;&lt;/code&gt;. Add key as &lt;code&gt;SLACK_WEBHOOK_URL&lt;/code&gt; and pair as a webhook URL that can be obtained from &lt;a href="https://slack.com/apps/A0F7XDUAZ-incoming-webhooks?next_id=0"&gt;Incoming Webhooks App&lt;/a&gt; to generate slack messages&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ZDwNIYli--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/338exp7nzt0h89fiesid.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ZDwNIYli--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/338exp7nzt0h89fiesid.png" alt="Alt Text" width="767" height="337"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  Submission Category:
&lt;/h3&gt;
&lt;h4&gt;
  
  
  DIY Deployments
&lt;/h4&gt;
&lt;h3&gt;
  
  
  Yaml File
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://github.com/revanth-reddy/Raitubazaar/blob/master/.github/workflows/django.yml"&gt;Link to Yaml File&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  Link to Code
&lt;/h3&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--566lAguM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/github-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/revanth-reddy"&gt;
        revanth-reddy
      &lt;/a&gt; / &lt;a href="https://github.com/revanth-reddy/Raitubazaar"&gt;
        Raitubazaar
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      Platform between fruits&amp;amp;vegetable vendors(farmers) and end-users
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;p&gt;&lt;a rel="noopener noreferrer" href="https://github.com/revanth-reddy/Raitubazaar/workflows/Django%20CI/badge.svg"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--5-TkDWFU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://github.com/revanth-reddy/Raitubazaar/workflows/Django%2520CI/badge.svg" alt="Django CI"&gt;&lt;/a&gt; &lt;a rel="noopener noreferrer" href="https://camo.githubusercontent.com/eaeb88aeb32115f7732668a589be6cc20d6c792b50fa0fd22238d0330b4e6653/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f7265706f2d73697a652f726576616e74682d72656464792f526169747562617a6161723f636f6c6f723d507572706c65266c6162656c3d526169747525323042617a616172266c6f676f3d646a616e676f266c6f676f436f6c6f723d6f72616e6765"&gt;&lt;img src="https://camo.githubusercontent.com/eaeb88aeb32115f7732668a589be6cc20d6c792b50fa0fd22238d0330b4e6653/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f7265706f2d73697a652f726576616e74682d72656464792f526169747562617a6161723f636f6c6f723d507572706c65266c6162656c3d526169747525323042617a616172266c6f676f3d646a616e676f266c6f676f436f6c6f723d6f72616e6765" alt="GitHub repo size"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h1&gt;
RaituBazaar&lt;/h1&gt;
&lt;a href="https://dev.to/revanthreddy" rel="nofollow"&gt;
  Follow me @ &lt;img src="https://camo.githubusercontent.com/1f3c6413af566c3bdc34d592cb5f299bf014242798daf4854b3c531ad522b904/68747470733a2f2f6432666c746978307632653073622e636c6f756466726f6e742e6e65742f6465762d62616467652e737667" alt="Revanth Reddy's DEV Profile" height="30" width="30"&gt;
&lt;/a&gt;
&lt;/div&gt;

  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/revanth-reddy/Raitubazaar"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;



&lt;h3&gt;
  
  
  Additional Resources
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://github.com/marketplace/actions/slack-github-actions-slack-integration"&gt;Slack GitHub Actions&lt;/a&gt;&lt;br&gt;
&lt;a href="https://github.com/act10ns/slack"&gt;Slack GitHub Actions Repo&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;PS: I have implemented the Slack Notification GitHub Action in one of my existing projects. You can add it to your existing projects too.&lt;/p&gt;

&lt;p&gt;Keep Exploring !!!&lt;/p&gt;

</description>
      <category>actionshackathon</category>
      <category>github</category>
      <category>opensource</category>
    </item>
    <item>
      <title>Introducing GraphQL ft. Django</title>
      <dc:creator>Revanth Reddy</dc:creator>
      <pubDate>Fri, 14 Aug 2020 06:55:33 +0000</pubDate>
      <link>https://forem.com/revanthreddy/introducing-graphql-ft-django-3o4d</link>
      <guid>https://forem.com/revanthreddy/introducing-graphql-ft-django-3o4d</guid>
      <description>&lt;p&gt;Hey There 👋!&lt;/p&gt;

&lt;p&gt;Hope everyone is safe and healthy. It's been 4 months since I was stuck at home because of the CoVid19 pandemic. So, during these times, while I was working on a REST Api for one of my Application, I encountered an article regarding GraphQL and that really impressed me and led me to write this post. In traditional REST APIs, we create URLs for all the data objects that are needed to be accessed. If we wanted to create a Question-Answer Forum - we'll need URLs for all Questions, URL for each question and URL for all answers of that specific question. So we are to do a lot of requests for such related data. &lt;/p&gt;

&lt;p&gt;And what if the user is experiencing a slow internet connection?&lt;/p&gt;

&lt;p&gt;Here comes GraphQL into the play. GraphQL isn't an API architecture like REST. It is a Query language to retrieve and manipulate related data in an easier way.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fw85dpaoas2zqn12ly3hi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fw85dpaoas2zqn12ly3hi.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  History
&lt;/h2&gt;

&lt;p&gt;Having its origin from Facebook, GraphQL has finally moved into the hands of GraphQL Foundation.&lt;/p&gt;

&lt;p&gt;Let's create an application for Question-Answer using GraphQL, Django. &lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;Let's Go 🚀&lt;/code&gt;
&lt;/h3&gt;

&lt;h2&gt;
  
  
  Schema
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Creating Types
&lt;/h3&gt;

&lt;p&gt;Types depict the data that the data object possess.&lt;/p&gt;

&lt;p&gt;Consider:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;type Answer {
  id: ID!
  answer: String!
}

type Question {
  id: ID!
  question: String!
  answers: [Answer]
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The ID type tells us that the field is the unique identifier for that type of data(also known as primary key).&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;code&gt;Note: The exclamation mark ! signifies that the field is required.&lt;/code&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Here we have primitive type &lt;code&gt;String&lt;/code&gt; (others being Int, Char)&lt;br&gt;
and also the custom type &lt;code&gt;Answer&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;The list type is enclosed in square brackets(&lt;code&gt;[Answer]&lt;/code&gt;)&lt;/p&gt;
&lt;h3&gt;
  
  
  Queries
&lt;/h3&gt;

&lt;p&gt;A Query is a question that we ask in to retrieve the data:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;type Query {
  question(id: ID!): Question
  answer(id: ID!): Answer
  answers: [Answer]
  questions: [Question]
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The above query will retrieve &lt;code&gt;Question&lt;/code&gt; and &lt;code&gt;Answer&lt;/code&gt; using their ID, and also &lt;code&gt;Question list&lt;/code&gt;, &lt;code&gt;Answer list&lt;/code&gt; without any filter&lt;/p&gt;

&lt;h3&gt;
  
  
  Mutations
&lt;/h3&gt;

&lt;p&gt;Mutation tells about the operations that can be done to change the data.&lt;br&gt;
Mutations need two things:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;Inputs&lt;/code&gt;: It is used to send an entire object rather than the individual fields.
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;input AnswerInput {
  id: ID
  answer: String!
}

input QuestionInput {
  id: ID
  question: String!
  answers: [AnswerInput]
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;Payloads&lt;/code&gt;: These depict the output of a mutation(just like a response from an API Endpoint)
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;type AnswerPayload {
  ok: Boolean
  answer: Answer
}

type QuestionPayload {
  ok: Boolean
  question: Question
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Here &lt;code&gt;ok&lt;/code&gt; field is similar to status in an API response.&lt;/p&gt;

&lt;p&gt;And Mutation binds &lt;code&gt;inputs&lt;/code&gt; &amp;amp; &lt;code&gt;payloads&lt;/code&gt; together:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;type Mutation {
  createAnswer(input: AnswerInput) : AnswerPayload
  createQuestion(input: QuestionInput) : QuestionPayload
  updateAnswer(id: ID!, input: AnswerInput) : AnswerPayload
  updateQuestion(id: ID!, input: QuestionInput) : QuestionPayload
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Schema
&lt;/h3&gt;

&lt;p&gt;Finally, we build the schema. It contains both the queries and mutations&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;schema {
    query: Query
    mutation: Mutation
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Python &amp;amp; GraphQL
&lt;/h2&gt;

&lt;p&gt;GraphQL is platform-independent, and its users are free to use any language(Python, Java, PHP, Go ...), frameworks(Node, Rails, Django).&lt;/p&gt;

&lt;p&gt;In Python we need not use GraphQL's syntax for creating the schema, we can directly use python but for that, we need a library called &lt;code&gt;Graphene&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;code&gt;Let's get into Action 👨‍💻&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;It's a good practice to maintain a virtual environment, requirements file and gitignore file.&lt;/p&gt;

&lt;p&gt;Let's create a folder and then initialize a virtual environment &lt;code&gt;myvenv&lt;/code&gt;(you can use your virtual environment name) in it.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mkdir quorum &amp;amp;&amp;amp; cd quorum
python3 -m venv myvenv
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now let's activate the virtual environment myvenv.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;source myvenv/bin/activate
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;Note: To exit the virtual environment, type &lt;code&gt;deactivate&lt;/code&gt; in the terminal.&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Installing packages
&lt;/h3&gt;

&lt;p&gt;Inside the virtual environment, we use &lt;code&gt;pip&lt;/code&gt; to install the required libraries:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pip install django
pip install graphene_django
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And we create a Django project:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;django-admin startproject qproj .
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A django project can have many applications. Apps are like the components within a project which can be reused.&lt;/p&gt;

&lt;p&gt;Let's create an app inside this project.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;python manage.py startapp qapp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After creating the app we need to tell Django that it should use it. We do that in the file &lt;code&gt;qproj/settings.py&lt;/code&gt; --open this folder in your code editor and open &lt;code&gt;settings.py&lt;/code&gt; file. &lt;/p&gt;

&lt;p&gt;We need to find INSTALLED_APPS and add &lt;code&gt;graphene_django&lt;/code&gt; &amp;amp; &lt;code&gt;qapp&lt;/code&gt;&lt;br&gt;
so finally it should look like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;...
...
INSTALLED_APPS = [
    'graphene_django',
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'qapp',
]
...
...
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Creating Models
&lt;/h3&gt;

&lt;p&gt;In the &lt;code&gt;qapp/models.py&lt;/code&gt; file we define all objects called Models – this is a place in which we will define our Question and Answer models.&lt;/p&gt;

&lt;p&gt;Let's open &lt;code&gt;qapp/models.py&lt;/code&gt; in the code editor, remove everything from it, and write code like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;from django.db import models

class Question(models.Model):
    question = models.CharField(max_length=100)

    def __str__(self):
        return self.question

class Answer(models.Model):
    answer = models.CharField(max_length=100)
    question = models.ForeignKey(Question, on_delete=models.CASCADE)

    def __str__(self):
        return self.answer
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now we have the blueprint of our models but we need to imprint that in our database. In django this thing is carried out by making migrations and migrating them.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;python manage.py makemigrations
python manage.py migrate
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now add a superuser(admin) who can handle the admin panel using:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;python manage.py createsuperuser
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In qapp/admin.py we register our models so that admin can access these models:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;from django.contrib import admin
from .models import Question, Answer

admin.site.register(Question)
admin.site.register(Answer)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now run server using &lt;code&gt;python manage.py runserver&lt;/code&gt; and visit &lt;a href="http://127.0.0.1:8000/admin" rel="noopener noreferrer"&gt;http://127.0.0.1:8000/admin&lt;/a&gt; or &lt;a href="http://localhost:8000/admin" rel="noopener noreferrer"&gt;http://localhost:8000/admin&lt;/a&gt; to see the admin dashboard.&lt;br&gt;
Add the relevant data to questions and answers.&lt;/p&gt;
&lt;h2&gt;
  
  
  Schema with Graphene
&lt;/h2&gt;
&lt;h3&gt;
  
  
  Queries
&lt;/h3&gt;

&lt;p&gt;In qapp folder, create a new file called &lt;code&gt;schema.py&lt;/code&gt; and define it as follows:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import graphene
from graphene_django.types import DjangoObjectType, ObjectType
from .models import Question, Answer

# Create a GraphQL type for the Answer model
class AnswerType(DjangoObjectType):
    class Meta:
        model = Answer

# Create a GraphQL type for the Question model
class QuestionType(DjangoObjectType):
    class Meta:
        model = Question
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the same file add the following Queries:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Create a Query
class Query(ObjectType):
    question = graphene.Field(QuestionType, id=graphene.Int())
    answer = graphene.Field(AnswerType, id=graphene.Int())
    questions = graphene.List(ActorType)
    answers= graphene.List(AnswerType)

    def resolve_answer(self, info, **kwargs):
        id = kwargs.get('id')
        if id is not None:
            return Answer.objects.get(pk=id)
        return None

    def resolve_question(self, info, **kwargs):
        id = kwargs.get('id')
        if id is not None:
            return Question.objects.get(pk=id)
        return None

    def resolve_answers(self, info, **kwargs):
        return Answer.objects.all()

    def resolve_questions(self, info, **kwargs):
        return Question.objects.all()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here we have written how the query works: as a single object using an &lt;code&gt;ID&lt;/code&gt; and as a &lt;code&gt;list&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Schema
&lt;/h3&gt;

&lt;p&gt;Add this to the end of qapp/schema.py&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;schema = graphene.Schema(query=Query)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Registering the schema
&lt;/h3&gt;

&lt;p&gt;To make this API available through the project we need to register and for that we need to import it in &lt;code&gt;qproj&lt;/code&gt;.&lt;br&gt;
So create a new &lt;code&gt;schema.py&lt;/code&gt; in qproj folder and the code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import graphene
import qapp.schema

class Query(qapp.schema.Query, graphene.ObjectType):
    # This class will inherit from multiple Queries
    # as we begin to add more apps to our project
    pass

schema = graphene.Schema(query=Query)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In &lt;code&gt;settings.py&lt;/code&gt; add the GRAPHENE schema. You can add it anywhere inside it. I'm adding it between INSTALLED_APPS and MIDDLEWARE.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;GRAPHENE = {
    'SCHEMA':'qproj.schema.schema'
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Unlike naive APIs, data can be accessed using only one endpoint in GraphQL. Let's create that url endpoint as &lt;code&gt;graphql/&lt;/code&gt; in &lt;code&gt;urls.py&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Open &lt;code&gt;qproj/urls.py&lt;/code&gt; and modify the code to:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;from django.contrib import admin
from django.urls import path
from graphene_django.views import GraphQLView
from .schema import schema

urlpatterns = [
    path('admin/', admin.site.urls),
    path('graphql/', GraphQLView.as_view(graphiql=True)),
]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  Test Test Test
&lt;/h1&gt;

&lt;p&gt;To check the API, we need to run the project. In terminal run the following code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;python manage.py runserver
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If there are no errors you can see a server running at port 8000 as follows&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F0wx9vyxpnt9taio8xmyn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F0wx9vyxpnt9taio8xmyn.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once the server is ready goto &lt;a href="http://127.0.0.1:8000/graphql/" rel="noopener noreferrer"&gt;http://127.0.0.1:8000/graphql/&lt;/a&gt;. You'll find a GraphQl editor. In this playground you can write queries, mutations(we didn't create mutations yet).&lt;/p&gt;

&lt;h2&gt;
  
  
  Building Queries
&lt;/h2&gt;

&lt;p&gt;In the admin panel I have added some relevant Questions and answers&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Ff8u9gk110a2i2j2o6m1u.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Ff8u9gk110a2i2j2o6m1u.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F4ncjd1v3ynmnn5ygphq8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F4ncjd1v3ynmnn5ygphq8.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now write some queries in the graphql editor at &lt;a href="http://127.0.0.1:8000/graphql/" rel="noopener noreferrer"&gt;http://127.0.0.1:8000/graphql/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F2v8acgw6e3cd0uaba3bb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F2v8acgw6e3cd0uaba3bb.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;br&gt;
Run the query by clicking on the run button to see the output.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fq330ptp381ui3usd979y.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fq330ptp381ui3usd979y.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Till now, we have are doing the querying part in graphql ide but what if you want to do it as a POST request &lt;br&gt;
An application communicating with your API would send POST requests to the &lt;code&gt;/graphql&lt;/code&gt; endpoint. Before we can make POST requests from outside the Django project, we need to change &lt;code&gt;urls.py&lt;/code&gt; as:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;from django.contrib import admin
from django.urls import path
from graphene_django.views import GraphQLView
from .schema import schema
from django.views.decorators.csrf import csrf_exempt # New library

urlpatterns = [
    path('admin/', admin.site.urls),
    path('graphql/', csrf_exempt(GraphQLView.as_view(graphiql=True))),
]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can turn off the graphql editor(Graphiql) by replacing &lt;code&gt;graphiql=True&lt;/code&gt; with &lt;code&gt;graphiql=False&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;CSRF&lt;/code&gt; means (Cross-Site Request Forgery)protection- an inbuilt feature of Django to prevent unauthenticated/ improperly authenticated users from doing evil things 👻.&lt;br&gt;
Though it's useful it would prevent external applications from interacting with the API. To counter the scarf exemption you might consider authentication or a more secured way to access the API.&lt;/p&gt;

&lt;p&gt;Now enter the following curl request in a new terminal keeping the server active&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;curl -X POST -H "Content-Type: application/json" --data '{ "query": "{ questions { question } }" }' http://127.0.0.1:8000/graphql/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You'll get a result something like this:&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fvqhxhraloogvwc21dj9j.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fvqhxhraloogvwc21dj9j.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Last Word
&lt;/h1&gt;

&lt;p&gt;Here we didn't work on changing the data(Mutations), you are to explore that part 😜.&lt;/p&gt;

&lt;h1&gt;
  
  
  Code References:
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://github.com/revanth-reddy/graphql-django" rel="noopener noreferrer"&gt;GitHub Repo&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/revanth-reddy" rel="noopener noreferrer"&gt;&lt;br&gt;
&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Foctodex.github.com%2Fimages%2Fdaftpunktocat-thomas.gif" alt="Revanth Reddy's GitHUB Profile"&gt;&lt;br&gt;
&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://revanth.tech" rel="noopener noreferrer"&gt;&lt;br&gt;
&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Foctodex.github.com%2Fimages%2FFintechtocat.png" alt="Revanth Reddy's DEV Profile"&gt;&lt;br&gt;
&lt;/a&gt;&lt;/p&gt;

</description>
      <category>graphql</category>
      <category>django</category>
      <category>healthydebate</category>
      <category>python</category>
    </item>
    <item>
      <title>My First Post</title>
      <dc:creator>Revanth Reddy</dc:creator>
      <pubDate>Thu, 21 May 2020 02:58:21 +0000</pubDate>
      <link>https://forem.com/revanthreddy/my-first-post-n50</link>
      <guid>https://forem.com/revanthreddy/my-first-post-n50</guid>
      <description>&lt;p&gt;This is my first blog post ever. Hopefully, I come up with a better post next time. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Hello World!&lt;/strong&gt; I am &lt;strong&gt;Revanth Reddy&lt;/strong&gt;, a final year Comp. Science undergrad from National Institute of Technology Durgapur.&lt;/p&gt;

&lt;p&gt;Long back, probably in my first year of college, I was introduced to Git and GitHub. It is really cool and interesting. And the curiosity led me to obtain my GitHub Student Education Pack. Using it I got my first domain &lt;a href="http://revanth.tech/"&gt;http://revanth.tech/&lt;/a&gt; . I learned React and using my React knowledge and sources from GitHub I developed my PortFolio and hosted it using GitHub pages and linked it to my domain. &lt;/p&gt;

&lt;p&gt;GitHub Education pack is really cool with many benefits for students. It helped me in learning Cloud services like AWS, Azure. I even told my friends and helped them in obtaining educational packs!&lt;/p&gt;

&lt;p&gt;In case if you don't have a pack then get one now! &lt;a href="https://education.github.com/pack"&gt;https://education.github.com/pack&lt;/a&gt;&lt;/p&gt;

</description>
      <category>octograd2020</category>
      <category>githubsdp</category>
      <category>devgrad2020</category>
      <category>showdev</category>
    </item>
  </channel>
</rss>
