본문 바로가기

프레임워크

(8)
웹팩 배우기 1 웹팩 배우기 1 참고자료 Understanding the Modern Web Stack: Webpack - The Basics (link) What is webpack? a bundler for javascript applications Get started install node; do it yourself start a npm project npm init -y create two files index.html script.js with respect to where index.html is function component () { const element = document.createElement('div'); element.innerHTML = _.join(['Hello&..
As a Beginner, going through Django Rest Framework tutorial: #2 1. Serialization Enough of Django basic settings. Now let's move on to the rest framework the very fisrt of which is Serialization. We start by creating a serializer as given in the tutorial # tutorial/snippets/serializers.py from rest_framework import serializers from snippets.models import Snippet, LANGUAGE_CHOICES, STYLE_CHOICES class SnippetSerializer(serializers.Serializer): id = serializer..
As a Beginner, going through Django Rest Framework tutorial: #1 Recently, I happened to start on a project to which I choose to use Django for the backend development. Any reason? Nah... I just felt like it, probably it was because Python was the one I was familiar with the most. In fact, this is my very first project as a developer in my life. Anyway, let's get to the point. I decided to write a series of posts about me as a newbie going through the officia..
VS Code ES7 React/Redux/React-Native/JS snippets JavaScript Imports import moduleName from 'module' // imp: Import a default export. import { destructuredModule } from 'module' //imd: Import a named export import React from 'react' //imr: Import React` import React, { Component } from 'react' //imrc: Import React and Component JavaScript Iteration arrayName.forEach(element => { } //fre: For each iteration for(let itemName of objectName { } //f..
Django http When a page is requested, Django creates an HttpRequest object that contains metadata about the request. Then Django loads the appropriate view, passing the HttpRequest as the first argument (request of index function below) to the view function. Each view is responsible for returning an HttpResponse object. # in views.py from djangp.http import HttpResponse def index(request): return HttpRespon..
Redux toolkit Installation # NPM npm install @reduxjs/toolkit # Yarn yarn add @reduxjs/toolkit # or npx create-react-app my-app --template redux ConfigureStore // Typical example import { configureStore } from '@reduxjs/toolkit' import rootReducer from './reducers' const store = configureStore({ reducer: rootReducer }) // The store now has redux-thunk added and the Redux DevTools Extension is ..
장고 모델 Database setup Setting up the database is done by updating the DATABASES variable in settings.py in the project folder. # project_folder/settings.py DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), } } As shown above, SQLite is the default database for which no additional setup is needed. However, any other databases like PostgreSQL..
장고 (Django) Start a project django-admin startproject project_name # say wqtl Start an app # in the project folder where manage.py is located python manage.py startapp app_name # say ohradical URL dispatcher Upon receiving a http request from a client, Django responds according to the procedure below: check ROOT_URLCONF in settings.py, the value of which becomes the starting point for mapping the given URL ..