django 기본 테스트는 데이터베이스 마이그레이션 덕에 느리고 번거롭기 때문에 py.test와 model_mommy를 사용해서 빠르게 테스트를 하는 방법을 소개함.
- py.test : http://pytest.org/
- pytest-django : http://pytest-django.readthedocs.org/
- model_mommy : http://model-mommy.readthedocs.org/
<html> | |
<head> | |
<title>Clipboard.js demo</title> | |
<style> | |
.tooltipped { | |
position: relative | |
} | |
.tooltipped:after { | |
position: absolute; | |
z-index: 1000000; |
""" | |
Django settings for djangogirls_tutorial project. | |
Generated by 'django-admin startproject' using Django 1.10.3. | |
For more information on this file, see | |
https://docs.djangoproject.com/en/1.10/topics/settings/ | |
For the full list of settings and their values, see | |
https://docs.djangoproject.com/en/1.10/ref/settings/ |
{ | |
"SECRET_KEY": "newew42l$!)no&7ad7%3j-8l^&ea=0)bh&80z_ul72$e-jsrbn" | |
} |
django 기본 테스트는 데이터베이스 마이그레이션 덕에 느리고 번거롭기 때문에 py.test와 model_mommy를 사용해서 빠르게 테스트를 하는 방법을 소개함.
자신의 git 프로젝트 폴더 안 .git/hooks/pre-commit 파일에 아래 내용을 넣으세요.
#!/bin/sh
FILES=$(git diff --cached --name-only --diff-filter=ACM | grep -e '\.py$')
if [ -n "$FILES" ]; then
flake8 $FILES
fi
# Pyenv 설치 (https://github.com/yyuu/pyenv-virtualenv)
brew install pyenv-virtualenv
# ~/.bash_profile 파일에 아래 내용 추가
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
# 사용할 Python 버전을 미리 깔고
pyenv install 3.6.0
This is how I configured the deploy of my rails apps to AWS Elastic Beanstalk through CircleCI.
On Project Settings > Environment Variables add this keys:
<script> | |
// Inject this code | |
var tag = document.createElement('script'); | |
tag.src = "https://www.youtube.com/iframe_api"; | |
var firstScriptTag = document.getElementsByTagName('script')[0]; | |
firstScriptTag.parentNode.insertBefore(tag, firstScriptTag); | |
var player; | |
function onYouTubeIframeAPIReady() { |
[uwsgi] | |
# Django-related settings | |
# the base directory (full path) | |
chdir = /home/ubuntu/(project-dir) | |
# Django's wsgi file | |
module = (project-name).wsgi:application | |
# the virtualenv (full path) | |
home = /home/ubuntu/.venv/(venv-name)/ |
server { | |
listen 80; | |
server_name example.com www.example.com; | |
location = /favicon.ico { access_log off; log_not_found off; } | |
location /static { | |
# STATIC ROOT | |
alias /home/ubuntu/(project_dir)/staticfiles; | |
expires -1; | |
} |