- 아래 명령들에서 필요한 프로그램을 설치하는 명령만 복사해서 설치해주세요.
- iTerm2 : https://formulae.brew.sh/cask/iterm2
- 파이참 프로페셔널 : https://formulae.brew.sh/cask/pycharm
- Visual Studio Code : https://formulae.brew.sh/cask/visual-studio-code
- 파이썬 버전 관리 매니저 pyenv : https://formulae.brew.sh/formula/pyenv
- 노드JS 버전 관리 매니저 nvm : https://formulae.brew.sh/formula/nvm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.db import models | |
class ChangedOnlySaveModel(models.Model): | |
def __init__(self, *args, **kwargs): | |
models.Model.__init__(self, *args, **kwargs) | |
self._initial_data = self.__dict__.copy() | |
def save(self, commit=True): | |
if not self.pk: | |
models.Model.save(self, commit) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
aero님께서 구현하신 구글/네이버/싸이월드/콩나물 좌표변환은 펄/자바스크립트로 되어있습니다. | |
펄/자바스크립트에 익숙지 않은지라, 수식을 파이썬으로 번역해보았습니다. | |
''' | |
from pyproj import Proj | |
from pyproj import transform | |
WGS84 = { 'proj':'latlong', 'datum':'WGS84', 'ellps':'WGS84', } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html> | |
<head> | |
<meta charset="utf-8" /> | |
<title>Melon 검색</title> | |
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" /> | |
</head> | |
<body> | |
<div class="container"> |
django-subdomains 라이브러리는 channels websocket URL 라우팅에 관여할 수 없습니다.
웹소켓에서도 urlpatterns를 지정하고 URL 별로 다른 Consumer를 지정할 수 있는데요. 서브도메인 별로 다른 urlpatterns를 가지도록 할 수 있느냐. 이를 위해 django-subdomains 라이브러리를 사용할 수 있느냐가 주제였습니다.
django-subdomains 라이브러리는 장고 미들웨어를 통해, 요청 도메인별로 root urlconf를 다르게 설정해주는 기능을 합니다. channels에서 django-subdomains이 사용가능하느냐인데요. 결론적으로는 django-subdomains는 channels를 지원할 수 없습니다.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# check root user | |
if [[ $EUID -ne 0 ]]; then | |
echo "This script must be run as root" 1>&2 | |
exit 1 | |
fi | |
# yum epel 저장소 추가 | |
yum install -y epel-release | |
# 아파치 웹서버 설치 및 시작 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding: utf-8 | |
import re | |
import urllib | |
from bs4 import BeautifulSoup | |
class MelonSong(object): | |
ARTIST_REGEXP = re.compile(r'.*goArtistDetail.*') | |
ALBUM_REGEXP = re.compile(r'.*goAlbumDetail.*') | |
SONG_REGEXP = re.compile(r'.*playSong.*') | |
NUMBER_PARAM_REGEXP = re.compile(r'[\'\",(\s](\d+)[\'\",)]') |
- 인터넷 옵션/보안에서 모든 존 (인터넷, 로컬인터넷, 신뢰사이트, 제한사이트) 에 대해 보호모드 사용 끄기
NewerOlder