본문 바로가기

Python_WEB/Tweetme

(16)
[Django]Bootstrap & Django Templates CodingEntrepreneurs Django 강의 정리 Bootstrap> https://ko.wikipedia.org/wiki/%EB%B6%80%ED%8A%B8%EC%8A%A4%ED%8A%B8%EB%9E%A9_(%ED%94%84%EB%A1%A0%ED%8A%B8%EC%97%94%EB%93%9C_%ED%94%84%EB%A0%88%EC%9E%84%EC%9B%8C%ED%81%AC) 부트스트랩 (프론트엔드 프레임워크) - 위키백과, 우리 모두의 백과사전 위키백과, 우리 모두의 백과사전. 부트스트랩(Bootstrap)은 웹사이트를 쉽게 만들 수 있게 도와주는 HTML, CSS, JS 프레임워크이다. 하나의 CSS 로 휴대폰, 태블릿, 데스크탑까지 다양한 기기에서 작동�� ko.wikipedia.org http..
[Django]Our First Template CodingEntrepreneurs Django 강의 정리 render> from django.shortcuts import render render(request, template_name, context=None, content_type=None, status=None, using=None) 1. 지정된 템플릿과 지정된 컨텍스트 사전 결합 및 반환 렌더링된 텍스트가 있는 HttpResponse 객체. DIRS> 1. 템플릿 원본 파일을 찾아야 하는 디렉터리 views.py> # tweets/views.py from django.http import HttpResponse, Http404, JsonResponse from django.shortcuts import render from .models i..
[Django]Dynamic View into REST API Endpoint CodingEntrepreneurs Django 강의 정리 JsonResponse> 1. JSON 인코딩 응답을 작성하는 데 도움이되는 HttpResponse 서브 클래스 수퍼 클래스에서 대부분의 동작을 몇 가지 차이점으로 상속합니다. 2. 기본 Content-Type 헤더는 application / json으로 설정되어 있습니다. 3. 첫 번째 매개 변수 인 data는 dict 인스턴스 여야합니다. 4. safe 매개 변수가 False로 설정되면 (아래 참조) JSON 직렬화 가능 객체 일 수 있습니다. 5. django.core.serializers.json.DjangoJSONEncoder로 기본 설정된 인코더는 데이터를 직렬화하는 데 사용됩니다. 6. 이 직렬화기에 대한 자세한 내용은 JSON 직렬..
[Django]Handling Dynamic Routing CodingEntrepreneurs Django 강의 정리 re_path> 1. Regular expression을 이용한 고급 path matching 2. 좀더 세밀한 조건 - 예를 들어 특정 문자열 길이를 갖는 문자열 검색 - 으로 검색 하고자 한다면 사용 3. regular expressions 은 the raw string literal syntax 로 선언되어야 합니다 (즉, 다음처럼 '' 로 닫혀 있어야 한다 가이드 문법> Symbol Meaning ^ 기술된 text 로 그 문자열이 시작되는지 $ 기술된 text 로 그 문자열이 끝나는지 \d 숫자(0, 1, 2, ... 9) 인지 \w word character 인지. 즉, 대소문자, 숫자, underscore character (_..
[Django]Intro to URL Routing and Dynamic Routing CodingEntrepreneurs Django 강의 정리 path> urlpatterns 포함할 요소를 반환합니다. int의 경우 10진수 문자열과 일치하는 경우를 말합니다. 가이드 urls.py> # tweetme2/urls.py from django.contrib import admin from django.urls import path from tweets.views import home_view, tweet_detail_view urlpatterns = [ path("admin/", admin.site.urls), path("", home_view), path("tweets/", tweet_detail_view), ] models.py> # tweets/models.py from django.d..
[Django]The Tweets Model CodingEntrepreneurs Django 강의 정리 tweets App 생성> python manage.py startapp tweets 디렉토리 확인> manage.py tweetme2/ tweets/ admin.py apps.py models.py tests.py views.py __init__.py migrations/ 추가된 파일 및 폴더> migrations 디렉터리 모델 수정시 데이터베이스를 업데이트 하는것을 가능하게 해줄 파일 모음 디렉터리 __init__.py Python Package로 인식하게 할 빈 파일 settings.py> # tweetme2/settings.py INSTALLED_APPS = [ "django.contrib.admin", "django.contrib.aut..
[Django]Our Roadmap CodingEntrepreneurs Django 강의 정리 각 메뉴 로드맵 작성> 1. Tweets -> Creating -> Text -> Image -> Delete -> Retweeting 2. Users -> Register -> Login -> Logout -> Profile -> Image -> Text -> Follow Button -> Feed -> User's feed only? -> User + Who they follow? 3. Following / Followers Long term todos - Notifications - DM - Explore -> finding hashtags
[Django]Setup Django Project CodingEntrepreneurs Django 강의 정리 project 생성> django-admin startproject tweetme2 . 디렉토리 확인> manage.py tweetme2/ __init__.py settings.py urls.py asgi.py wsgi.py 각 파일의 의미> __init__.py Python 패키지로 다루도록 지시 settings.py 웹사이트의 모든 설정을 포함 urls.py 사이트의 url - view의 연결을 지정 wsgi.py 웹서버와 연결 및 소통하는 것을 도와줌 manage.py 어플리케이션을 생성 하고 데이터베이스와 작ㅇ버하고 개발웨 서버를 시작하기 위해 사용