kwang hyun kim construction of a class schedule · construction of a class schedule website via...

13
KWANG HYUN KIM BRIAN RYU CONSTRUCTION OF A CLASS SCHEDULE WEBSITE via Django and GraphQL

Upload: others

Post on 20-May-2020

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: KWANG HYUN KIM CONSTRUCTION OF A CLASS SCHEDULE · CONSTRUCTION OF A CLASS SCHEDULE WEBSITE via Django and GraphQL. KWANG KIM ... • Pure Python code and is a mapping between URL

KWANG HYUN KIMBRIAN RYU

CONSTRUCTION OF A CLASS SCHEDULE

WEBSITEvia Django and GraphQL

Page 2: KWANG HYUN KIM CONSTRUCTION OF A CLASS SCHEDULE · CONSTRUCTION OF A CLASS SCHEDULE WEBSITE via Django and GraphQL. KWANG KIM ... • Pure Python code and is a mapping between URL

KWANG KIMBRIAN RYU

PREVIOUS SEMESTER

Learned web technology and languages needed:

React Library – Javascript Library

Tic Tac Toe Game Examples

• Hardcoded CSS

• 3 by 3, static win condition

• Dynamic Generator

• n by n, user input

• Incorporates inline styling and styled components

• Dynamic win condition

2

FALL 2018

Page 3: KWANG HYUN KIM CONSTRUCTION OF A CLASS SCHEDULE · CONSTRUCTION OF A CLASS SCHEDULE WEBSITE via Django and GraphQL. KWANG KIM ... • Pure Python code and is a mapping between URL

KWANG KIMBRIAN RYU

Develop Server Side Code• Use Django web framework to develop

• Connect front-side React framework and server-side Django framework efficiently

• Connect them by using GraphQL

3

OUR GOAL

Page 4: KWANG HYUN KIM CONSTRUCTION OF A CLASS SCHEDULE · CONSTRUCTION OF A CLASS SCHEDULE WEBSITE via Django and GraphQL. KWANG KIM ... • Pure Python code and is a mapping between URL

KWANG KIMBRIAN RYU

WHY DJANGO?Django takes care of much of the hassle of Web development, so you can focus on writing your app

Versatility

• Take Web applications from concept to launch in a matter of hours

• Designed to help developers take applications from concept to completion as quickly as possible

• Used to build diverse range of things

• Content management systems

• Social networks

• Scientific computing platforms

Features

• Includes dozens of extras used to handle common Web development tasks

• user authentication, content administration, site maps, RSS feeds, and many more

• Scalable to meet the heaviest traffic demands

• Reassuringly secure to avoid common security mistakes

• SQL injection

• Cross-site scripting and request forgery

• Clickjacking

• User authentication system

4

Page 5: KWANG HYUN KIM CONSTRUCTION OF A CLASS SCHEDULE · CONSTRUCTION OF A CLASS SCHEDULE WEBSITE via Django and GraphQL. KWANG KIM ... • Pure Python code and is a mapping between URL

KWANG KIMBRIAN RYU 5

HOW DJANGO WORKS

https://www.slideshare.net/fishwarter/the-django-web-application-framework-2-1221388

MVT Architecture

• Controller

• The Django framework

• URL dispatcher

• Views

• Controls what a user sees

• Models

• Describes your data

structure/schema

• Templates

• How a user sees it

Page 6: KWANG HYUN KIM CONSTRUCTION OF A CLASS SCHEDULE · CONSTRUCTION OF A CLASS SCHEDULE WEBSITE via Django and GraphQL. KWANG KIM ... • Pure Python code and is a mapping between URL

KWANG KIMBRIAN RYU

URLconf• URL configuration

• Pure Python code and is a mapping between URL path expressions to Python functions (in views.py)

• Constructed dynamically as it is pure Python code

• Mapping can be as short or long as needed

6

URL

urls.py

Page 7: KWANG HYUN KIM CONSTRUCTION OF A CLASS SCHEDULE · CONSTRUCTION OF A CLASS SCHEDULE WEBSITE via Django and GraphQL. KWANG KIM ... • Pure Python code and is a mapping between URL

KWANG KIMBRIAN RYU

View function• A Python function that takes a Web

request and returns a Web response

• View itself contains arbitrary logic that is necessary to return that response

• Renders HTML template file

7

VIEWS

views.py

Page 8: KWANG HYUN KIM CONSTRUCTION OF A CLASS SCHEDULE · CONSTRUCTION OF A CLASS SCHEDULE WEBSITE via Django and GraphQL. KWANG KIM ... • Pure Python code and is a mapping between URL

KWANG KIMBRIAN RYU

Classes• Course

• ID, name, instructor, week, start, end

• Instructor is a class within Course class

• Instructor

• Rank: full, associate, assistant, lecturer

• Role: full-time, part-time

• Need these attributes for course assignment order designation

8

MODELS

models.py

Page 9: KWANG HYUN KIM CONSTRUCTION OF A CLASS SCHEDULE · CONSTRUCTION OF A CLASS SCHEDULE WEBSITE via Django and GraphQL. KWANG KIM ... • Pure Python code and is a mapping between URL

KWANG KIMBRIAN RYU 9

TEMPLATES

templates/scheduler/base.html

• Used for a convenient way to generate HTML dynamically

• Contains the static parts of the desired HTML output

• Also contains special syntax for describing how dynamic content will be added

• Use of base templates allow for inheritance

templates/scheduler/show_courses.html

Page 10: KWANG HYUN KIM CONSTRUCTION OF A CLASS SCHEDULE · CONSTRUCTION OF A CLASS SCHEDULE WEBSITE via Django and GraphQL. KWANG KIM ... • Pure Python code and is a mapping between URL

KWANG KIMBRIAN RYU 10

Page 11: KWANG HYUN KIM CONSTRUCTION OF A CLASS SCHEDULE · CONSTRUCTION OF A CLASS SCHEDULE WEBSITE via Django and GraphQL. KWANG KIM ... • Pure Python code and is a mapping between URL

KWANG KIMBRIAN RYU

Connect frameworks• Server-wide framework in Django is not “very dynamic”

• Use React (for views) and Django (models and DB)

• Connect them by using GraphQL for ”data sharing”

11

FUTURE PLANS

Page 12: KWANG HYUN KIM CONSTRUCTION OF A CLASS SCHEDULE · CONSTRUCTION OF A CLASS SCHEDULE WEBSITE via Django and GraphQL. KWANG KIM ... • Pure Python code and is a mapping between URL

KWANG KIMBRIAN RYU 12

Works Cited

“Django.” Django, www.djangoproject.com/.

fishwarter Follow. “The Django Web Application Framework 2.” LinkedIn SlideShare, 30 Mar. 2009,

www.slideshare.net/fishwarter/the-django-web-application-framework-2-1221388.

“GraphQL: A Query Language for APIs.” A Query Language for Your API, graphql.org/.

Page 13: KWANG HYUN KIM CONSTRUCTION OF A CLASS SCHEDULE · CONSTRUCTION OF A CLASS SCHEDULE WEBSITE via Django and GraphQL. KWANG KIM ... • Pure Python code and is a mapping between URL

THANK YOU

Brian Ryu

+1 347 854 7437

[email protected]

https://repl.it/@bryu31

13

KWANG KIMBRIAN RYU