Django with React

[Day1] Clone Coding

22.01.14(Fri)

  1. Create Django Webapp

[Day2] Clone Coding

22.01.16(Sat)

  • AWS build pipeline
price for connect django and AWS

[Day3] Clone coding of netflix

Ref: https://www.youtube.com/watch?v=XtMThy8QKqU&t=3935s

[Dy4] Connect Django and Crawler

How to upload image in django: http://www.learningaboutelectronics.com/Articles/How-to-insert-images-into-a-database-table-with-Python-in-Django.php

  • it might be needed another server (e.g. S3?)

[Day5]

Set up AWS EC2, S3

22.01.29(Sat)

  • after editing privacy group, i can’t login to server (Putty: Connection Time Our error)

Connect Django & React with REST API framework

compare workflow of references

  • Ref2. Installed Apps 1) main service app, 2) corsheaders app (and also edit middleware, cors whitelist), 3) rest_framework →
    edit settings.py to declare main port →
    (create Serializer) create serializer python script in (main service app) →
    (create View) edit(or create) view.py →
    (URL pattern) edit url.py →
    test API working status (in http://localhost:8000/api)
    (CREATE REACT APP) →
    install bootstrap, reactstrap package →
    edit index.js to add ‘bootstrap.min.css’ →
    create ‘CustomModal’ class (i don’t know why) →
    edit package.json to enable proxy (port #8000) →
    edit App.js to implement GET method
  • Ref3. Installed Apps 1) main service app, 2) corsheaders app (and also edit middleware, cors whitelist), 3) rest_framework →
    (create Serializer) create serializer python script in (main service app) →
    (create View) edit(or create) view.py →
    (URL pattern) edit url.py →
    test API working status (in http://localhost:8000/api)
    (CREAT REACT APP) →
    edit package.json to enable proxy (port #8000) →
    (?) edit url.py to enable django url routing (+ frontend npm build)→
    (?) edit settings.py to what..
  • CORS (Cross-Origin Resource Sharing): prevent privacy issue when port numbers are different in btw client and server

[Day6, 7] last day

22.01.30, 01.31

  • Backend setting: django-admin (create main app) → python manage.py startapp (create api/DB/… app)
  • Frontend setting: npx create-react-app frontend
  • API setting: (baseline — here)
    Difference1. HometemplateView setup → from django.views.generic import ProductView is wrong
    Difference2. as_view() should need argument (e.g. {‘get’: ‘list’})
    *Limitation: this ref don’t have show interaction precisely btw frontend and backend → tunneling through axios should be edited!
  • Django connect with React: GET & POST
  • Edit React App
    html, css…
  • #Deploy: EC2 setting
  • when CORS error evoked: setting BASE_URL in axios.js to ‘http://localhost:8000/api/{name_of_my_app}’, (I got stuck in this problem…
    Invalid Case1. BASE_URL = ‘http://localhost:8000’ , axios.get(‘/api/{my_app}’) → CORS error
    Invalid Case2. BASE_URL = ‘http://loaclhost:8000/api’, axios.get(‘/{my_app}) → CORS error

--

--

인적자원개발과 학습분석에 관심이 있습니다. Interested in HRD and Learning Analytics

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Jee Hun Sung

인적자원개발과 학습분석에 관심이 있습니다. Interested in HRD and Learning Analytics