Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
thecodinghouse committed Dec 22, 2014
0 parents commit 7412ba6
Show file tree
Hide file tree
Showing 506 changed files with 47,035 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
*.pyc
*.pyo
*.db
.DS_Store
.coverage
local_settings.py
/static
10 changes: 10 additions & 0 deletions .hgignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
syntax: glob
*.pyc
*.pyo
*.db
.DS_Store
.coverage
local_settings.py

syntax: regexp
^static/
Empty file added __init__.py
Empty file.
1 change: 1 addition & 0 deletions deploy/crontab
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*/5 * * * * %(user)s %(manage)s poll_twitter
7 changes: 7 additions & 0 deletions deploy/gunicorn.conf.py.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from __future__ import unicode_literals
import multiprocessing

bind = "127.0.0.1:%(gunicorn_port)s"
workers = multiprocessing.cpu_count() * 2 + 1
loglevel = "error"
proc_name = "%(proj_name)s"
37 changes: 37 additions & 0 deletions deploy/local_settings.py.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
from __future__ import unicode_literals

SECRET_KEY = "%(secret_key)s"
NEVERCACHE_KEY = "%(nevercache_key)s"
ALLOWED_HOSTS = [%(domains_python)s]

DATABASES = {
"default": {
# Ends with "postgresql_psycopg2", "mysql", "sqlite3" or "oracle".
"ENGINE": "django.db.backends.postgresql_psycopg2",
# DB name or path to database file if using sqlite3.
"NAME": "%(proj_name)s",
# Not used with sqlite3.
"USER": "%(proj_name)s",
# Not used with sqlite3.
"PASSWORD": "%(db_pass)s",
# Set to empty string for localhost. Not used with sqlite3.
"HOST": "127.0.0.1",
# Set to empty string for default. Not used with sqlite3.
"PORT": "",
}
}

SECURE_PROXY_SSL_HEADER = ("HTTP_X_FORWARDED_PROTOCOL", "https")

CACHE_MIDDLEWARE_SECONDS = 60

CACHE_MIDDLEWARE_KEY_PREFIX = "%(proj_name)s"

CACHES = {
"default": {
"BACKEND": "django.core.cache.backends.memcached.MemcachedCache",
"LOCATION": "127.0.0.1:11211",
}
}

SESSION_ENGINE = "django.contrib.sessions.backends.cache"
48 changes: 48 additions & 0 deletions deploy/nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@

upstream %(proj_name)s {
server 127.0.0.1:%(gunicorn_port)s;
}

server {

listen 80;
%(ssl_disabled)s listen 443 ssl;
server_name %(domains_nginx)s;
client_max_body_size 10M;
keepalive_timeout 15;

%(ssl_disabled)s ssl_certificate conf/%(proj_name)s.crt;
%(ssl_disabled)s ssl_certificate_key conf/%(proj_name)s.key;
%(ssl_disabled)s ssl_session_cache shared:SSL:10m;
%(ssl_disabled)s ssl_session_timeout 10m;
%(ssl_disabled)s ssl_ciphers RC4:HIGH:!aNULL:!MD5;
%(ssl_disabled)s ssl_prefer_server_ciphers on;

location / {
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Protocol $scheme;
proxy_pass http://%(proj_name)s;
}

location /static/ {
root %(proj_path)s;
access_log off;
log_not_found off;
}

location /robots.txt {
root %(proj_path)s/static;
access_log off;
log_not_found off;
}

location /favicon.ico {
root %(proj_path)s/static/img;
access_log off;
log_not_found off;
}

}
11 changes: 11 additions & 0 deletions deploy/supervisor.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[group:%(proj_name)s]
programs=gunicorn_%(proj_name)s

[program:gunicorn_%(proj_name)s]
command=%(venv_path)s/bin/gunicorn_django -c gunicorn.conf.py -p gunicorn.pid
directory=%(proj_path)s
user=%(user)s
autostart=true
autorestart=true
redirect_stderr=true
environment=LANG="%(locale)s",LC_ALL="%(locale)s",LC_LANG="%(locale)s"
Loading

0 comments on commit 7412ba6

Please sign in to comment.