Skip to content

Instantly share code, notes, and snippets.

@allieus
allieus / README.md
Last active February 26, 2024 13:08
윈도우 기본 개발 프로그램 설치

윈도우 기본 개발 프로그램 설치

  • 아래 명령들에서 필요한 프로그램을 설치하는 명령만 복사해서 설치해주세요.
@allieus
allieus / README.md
Last active February 8, 2024 00:48
맥 개발 팩키지 설치
@allieus
allieus / README.md
Created July 5, 2016 02:58
네이버 웹툰 크롤링

주의

  • 본 스크립트는 학술목적으로만 사용해주세요.
  • 만화책은 구매해서 보시고, 웹툰은 웹툰 서비스를 통해 감상해주세요. :-)
@allieus
allieus / extend.py
Created August 30, 2011 02:37
Update for ONLY changed fields
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)
@allieus
allieus / gist:1180051
Last active June 25, 2022 18:10
wgs84/tm127/tm128/grs80/cyworld 간 좌표변환
'''
aero님께서 구현하신 구글/네이버/싸이월드/콩나물 좌표변환은 펄/자바스크립트로 되어있습니다.
펄/자바스크립트에 익숙지 않은지라, 수식을 파이썬으로 번역해보았습니다.
'''
from pyproj import Proj
from pyproj import transform
WGS84 = { 'proj':'latlong', 'datum':'WGS84', 'ellps':'WGS84', }
@allieus
allieus / askdjango_vod_frontend_jquery_sample.html
Created September 4, 2017 08:39
AskDjango VOD, 웹프론트엔드 시작편, jQuery 샘플
<!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">

TL;DR

django-subdomains 라이브러리는 channels websocket URL 라우팅에 관여할 수 없습니다.

배경

웹소켓에서도 urlpatterns를 지정하고 URL 별로 다른 Consumer를 지정할 수 있는데요. 서브도메인 별로 다른 urlpatterns를 가지도록 할 수 있느냐. 이를 위해 django-subdomains 라이브러리를 사용할 수 있느냐가 주제였습니다.

django-subdomains 라이브러리는 장고 미들웨어를 통해, 요청 도메인별로 root urlconf를 다르게 설정해주는 기능을 합니다. channels에서 django-subdomains이 사용가능하느냐인데요. 결론적으로는 django-subdomains는 channels를 지원할 수 없습니다.

@allieus
allieus / z_allinone.sh
Last active December 20, 2021 14:24
centos 7.2 에 장고 프로젝트 배포 (using ncloud VM)
# 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
# 아파치 웹서버 설치 및 시작
@allieus
allieus / melon_playlist_parser.py
Last active October 12, 2021 06:05
멜론, 플레이리스트 목록 파서
# 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+)[\'\",)]')
@allieus
allieus / README.md
Last active July 1, 2021 07:39
selenium 을 통한 홈택스 자동화 심플 예제

Download, Internet Explorer Driver Server

필요조건

  • 인터넷 옵션/보안에서 모든 존 (인터넷, 로컬인터넷, 신뢰사이트, 제한사이트) 에 대해 보호모드 사용 끄기