KWANG HYUN KIMBRIAN RYU
CONSTRUCTION OF A CLASS SCHEDULE
WEBSITEvia Django and GraphQL
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
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
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
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
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
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
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
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
KWANG KIMBRIAN RYU 10
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
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/.
THANK YOU
Brian Ryu
+1 347 854 7437
https://repl.it/@bryu31
13
KWANG KIMBRIAN RYU