본문 바로가기

BE13

[Django REST API] 13. Deploying on AWS 1. Add key pair to AWS (1) 이걸 하는 이유? 서버에 접속할 때 ssh authentication을 해야하기 때문. 깃허브에 ssh 등록할 때도, ssh key를 일단 만든 다음에 local system에 추가하고, public key를 깃허브에 올렸지. 똑같이 할 거다. ssh key pair public file의 내용을 꺼내온다 cat ~/.ssh/id_rsa.pub aws 에 key 등록 2. key pair 로 ec2 서버 하나 런칭 생략 3. delploy용 파일 작업 (1) setup.sh #!/usr/bin/env bash set -e # CHANGEME.git을 내 git repo로 바꾸기 PROJECT_GIT_URL='https://github.com/CHANGEME.. 2021. 12. 26.
[Django REST API] 12. Create profile feed API 1. Plan profile feed 2. Add feed model 3. Create profile feed serializer 4. Create Viewset for profile feed item 5. Add permissions 1. Plan profile feed (1) Requirements CRUD feed items R other user's feed items (2) API URLs 2. Add feed model (1) model 만들기 (2) admin 페이지 등록 3, 4. Create profile serializer, viewset 5. Add permissions # permissions.py class UpdateOwnStatus(permissions.BasePermissio.. 2021. 12. 25.
[Django REST API] 11. Create login API 1. Create login API viewset 2. Set token header using ModHeader extension 1. Create login API viewset (1) 구현 # views.py ... # ObtainAuthToken: AuthToken을 만드는 view from rest_framework.authtoken.views import ObtainAuthToken from rest_framework.settings import api_settings ... class UserLoginApiView(ObtainAuthToken): """Handle creating user authentication tokens""" # 일반적으로 제공되는 상속용 view들은 # rendere.. 2021. 12. 24.
[Django REST API] 10. Create Profiles API 1. Plan of Profiles API 2. Create user profile serializer 3. Create profiles Viewset 4. Add authentication and permissions 5. Add search feature 1. Plan of Profiles API (1) Create new profile Handle registration of new users Validate profile data (2) Listing existing profile Show Id ,Email and name A way to search for user (3) View specific profile (4) Update profile of logged in user User cna c.. 2021. 12. 22.
[Django REST API] 9. Introduction to Viewsets Django REST framework는 API endpoints를 만드는데 필요한 두 개의 helper classes를 제공한다. APIView와 ViewSet이 그것이다. 앞서서 APIView를 다뤘고 여기서는 ViewSet을 다룬다. 1. What is a Viewset? 2. Create a simple Viewset 3. Add create, retrieve, update, partial_update and destroy functions 1. What is a Viewset? HTTP methods에 mapping되는 함수를 정의하는 대신에, common API object actions에 mapping 되는 몇개의 functions을 받아들인다. def list: Getting a list .. 2021. 12. 20.
[Django REST API] 8. Introduction to API Views Django REST framework는 API endpoints를 만드는데 필요한 두 개의 helper classes를 제공한다. APIView와 ViewSet이 그것이다. 여기서는 APIView를 다룬다. 1. APIView란? 2. Create APIView 3. Configure view URL 4. Test APIView 5. Create Serializer 6. Add POST method 7. Test POST 8. Add PUT, PATCH, DELETE methods 9. Test PUT, PATCH, DELETE 1. APIView란? standard HTTP methods 에 맞는 functions을 정의할 수 있게 해준다. 간단한 db 조작을 넘어서 복잡한 조작을 해야 할 수록 더 .. 2021. 12. 18.
[Django REST API] 7. Setup Django Admin 1. Create superuser 2. Enable django admin 3. Test django admin 1. Create superuser 2. Enable django admin 3. Test django admin 4. commit 2021. 12. 18.
[Django REST API] 6. Setup the Database 1. Create user database model 2. Add user model manager 3. Set custom user model 4. create migrations and sync DB cf-1. auth-custom-user https://docs.djangoproject.com/en/2.2/topics/auth/customizing/#auth-custom-user Customizing authentication in Django | Django documentation | Django Django The web framework for perfectionists with deadlines. Overview Download Documentation News Community Code .. 2021. 12. 18.
[Django REST API] 5. Creating a Django app 1. Create Python Virtual Environment 2. Install required Python packages 3. Create new Django project & app 4. Enable app in Django settings file 5. Test and commit 1. Create Python Virtual Environment vagrant develop server에 virtual environment 설정하기 (1) pipenv 사용법 https://python-guide.readthedocs.io/en/latest/dev/virtualenvs/ Pipenv & Virtual Environments — The Hitchhiker's Guide to Python docs.. 2021. 12. 18.
[Django REST API] 4. Creating a development server 차례 1. Create Vagrantfile 2. Configure Vagrant box 3. Running and connecting dev server 4. Running Hello world script 1. Create Vagrantfile (1) 기본 vagrantfile 만들기 ubuntu/bionic64 base image 를 바탕으로 vagrant 파일 만들기 vagrant box catalog에서 public available한 image임 (2) file 확인 2. Configure vagant box Vagrantfile 내용을 다음 내용으로 붙여넣기 하기 https://gist.github.com/LondonAppDev/199eef145a21587ea866b69d40d28682 C1.. 2021. 12. 17.
[Django REST API] 3. Setting up project 1. workspace 만들기 생략 2. Git project 만들기 git init (1) readme.md 만들기 github markdown cheatsheet https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet GitHub - adam-p/markdown-here: Google Chrome, Firefox, and Thunderbird extension that lets you write email in Markdown and rende Google Chrome, Firefox, and Thunderbird extension that lets you write email in Markdown and render it before se.. 2021. 12. 16.
[Django REST API] 2. cheat-sheet Git Use the below Git commands in the Windows Command Prompt or macOS Terminal. Configure default email and name Note: This only needs to be done the first time you use Git on your machine git config --global user.email "your@email.com" git config --global user.name "Your Name" Initialise a new Git repository git init Commit changes to Git git add . git commit -am "Commit message" Set Git remote.. 2021. 12. 16.
[Django REST API] 1. 개요 1. 과정 1. course introduction 2. setting up dev environment 3. setting up project 4. create dev server 5. create django app 6. setup the database 7. setup django admin 8. introduction to APIview 9. introduction to ViewSets 10. Create User Profiles API 11. Create login API 12. Create profile feed API 13. Deploy API to server on AWS 2. 필요한 기술 1. development server (1) VAGRANT 우리 앱에 필요한 서버가 무엇인지 명시해.. 2021. 12. 16.