# The local branch is named LOCAL and the remote branch is named REMOTE
$ git checkout -b LOCAL-track origin/REMOTE
$ git branch -d LOCAL
$ git branch -m LOCAL
#Makefile
PORT:=9000
PROJECT:=project
start-uwsgi:
uwsgi --socket 127.0.0.1:$(PORT) \
--chdir $(shell pwd) \
--wsgi-file $(PROJECT)/wsgi.py \
import sys
def fn():
pass
sys.modules[__name__] = fn
#dependencies
- pyinit
- virtuanenv
#workflow
pyinit #create setup.py template
- create a new redis .conf file
$ cp /etc/redis.conf /etc/redis-xxx.conf
- edit /etc/redis-xxx.conf, illustrated as below
...
def path_prefix(path):
def wrapper(instance, filename):
ext = filename.split('.')[-1]
filename = '{}.{}'.format(uuid4().hex, ext)
return os.path.join(path, filename)
return wrapper
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
host:=0.0.0.0 | |
port:=8000 | |
activate_venv=source venv/bin/activate | |
debug: | |
./manage.py runserver $(host):$(port) | |
start-uwsgi: | |
$(activate_venv) \ | |
&& uwsgi --socket 127.0.0.1:$(port) \ |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
yum groupinstall "Development tools"
yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel
#nginx.repo
[nginx]
name=nginx repo
baseurl=http://nginx.org/packages/centos/$releasever/$basearch/
gpgcheck=0
enabled=1
OlderNewer