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
input() |
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
<!-- 아래와 같은 폼 뷰를 사용할 경우 --> | |
{{ form.nametest }} | |
<!-- 결과 물 --> | |
<input type='radio' name='on_change' id='test' class='class'/> |
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
# Form Input tag example | |
# forms.py | |
def set_field_html_name(field, new_name): | |
""" | |
:param field: 대상 필드 | |
:param new_name: 변경할 이름 type(str) | |
html tag에 name 옵션을 Django Form Field Variable(변수)가 아닌 | |
new_name 인자로 강제 할당 |
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
<!-- 아래와 같은 폼 뷰를 사용할 경우 --> | |
{{ form.nametest }} | |
<!-- 결과 물 --> | |
<input type='radio' name='nametest' id='test' class='class'/> |
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
# views.py | |
from django.views.generic.base import TemplateView | |
class Test(TemplateView): | |
template_name = 'yankee/result.html' | |
def get_context_data(self, **kwargs): | |
context = super().get_context_data(**kwargs) | |
context['form'] = TestForm |
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
# Form Input tag example | |
# forms.py | |
class TestForm(forms.modelsForm): | |
nametest = forms.Charfield(required=False, widget=forms.TextInput(attrs={ | |
'name':'on_change', | |
'id':'test', | |
'class':'class', | |
'type':'radio', | |
}) |
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
import glob | |
import os, random, struct | |
from Cryptodome.Cipher import AES | |
def encrypt_file(key, in_filename, out_filename=None, chunksize=64*1024): | |
if not out_filename: | |
out_filename = in_filename + '.yankee' # out_filename 인자를 지정안할 경우 기존 파일명을 사용하여 .yank 라는 확장명 추가 | |
iv = os.urandom(16) # 랜덤한 16자리의 Byte값을 생성 | |
encryptor = AES.new(key ,AES.MODE_CBC, iv) # cryptodomex 모듈의 AES를 이용해서 암호화 키를 생성 |
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
import glob | |
import os, random, struct | |
from Crypto.Cipher import AES | |
def encrypt_file(key, in_filename, out_filename=None, chunksize=64*1024): | |
""" Encrypts a file using AES (CBC mode) with the | |
given key. | |
key: | |
The encryption key - a string that must be | |
either 16, 24 or 32 bytes long. Longer keys |
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
sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 5811E89F3A912897C070ADBF76221572C52609D |
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
sudo apt-add-repository 'deb https://apt.dockerproject.org/repo ubuntu-xenial main' # Docker Repo 추가 | |
sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 5811E89F3A912897C070ADBF76221572C52609D # GPG Key 추가 | |
sudo apt update -y # 저장소 업데이트 및 다운로드 | |
sudo apt install docker-engine -y # Docker 설치 | |
sudo docker --version # Docker Version 확인 | |
sudo systemctl docker status # Docker 상태 확인 |