Skip to content

Commit

Permalink
use django
Browse files Browse the repository at this point in the history
  • Loading branch information
atdt committed Oct 31, 2011
1 parent 97a7b5f commit 731855b
Show file tree
Hide file tree
Showing 41 changed files with 249 additions and 749 deletions.
11 changes: 4 additions & 7 deletions .gitignore
@@ -1,9 +1,6 @@
*.egg-info
*.pyc
*.pyo
.DS_Store
.epio-app
dist
docs/_build
env
production.cfg
*.swp
*.un~
*.db
static_root/
14 changes: 0 additions & 14 deletions LICENSE

This file was deleted.

4 changes: 0 additions & 4 deletions README.md

This file was deleted.

Empty file added __init__.py
Empty file.
14 changes: 9 additions & 5 deletions epio.ini
@@ -1,18 +1,22 @@
# epio.ini for permabank

[django]
append_settings = false
base = .

[wsgi]
requirements = requirements.txt
entrypoint = permabank:app

[static]
/static = permabank/static

[services]
postgres = true
redis = true

[redis]
memory = 16

[static]
/static = static_root
/media = ../data

[env]
EPIO = true
PERMABANK_SETTINGS = ../production.cfg
Empty file added epio_commands/__init__.py
Empty file.
Empty file.
Empty file.
10 changes: 10 additions & 0 deletions epio_commands/management/commands/epio_flush_cache.py
@@ -0,0 +1,10 @@
from django.core.cache import cache

from django.core.management.base import NoArgsCommand

class Command(NoArgsCommand):
help = 'Flushes the cache.'

def handle_noargs(self, **options):
cache.clear()
print "Cache flushed."
12 changes: 12 additions & 0 deletions epio_commands/management/commands/epio_flush_redis.py
@@ -0,0 +1,12 @@
import redis
from bundle_config import config

from django.core.management.base import NoArgsCommand

class Command(NoArgsCommand):
help = 'Flushes all keys in redis.'

def handle_noargs(self, **options):
r = redis.Redis(host=config['redis']['host'], port=int(config['redis']['port']), password=config['redis']['password'])
r.flushall()
print "All redis keys flushed."
Empty file added epio_commands/models.py
Empty file.
21 changes: 21 additions & 0 deletions fabfile.py
@@ -0,0 +1,21 @@
from fabric.api import local, env

def production():
env['epioapp'] = # production epio instance name

def staging():
env['epioapp'] = # staging epio instance

def epio(commandstring):
local("epio {0} -a {1}".format(
commandstring,
env['epioapp']))

def deploy():
""" An example deploy workflow """
local("./manage.py collectstatic")
epio('upload')
epio('django syncdb')
epio('django migrate')
epio('django epio_flush_cache')

2 changes: 2 additions & 0 deletions install_deps
@@ -0,0 +1,2 @@
#!/usr/bin/env bash
pip install -r requirements.txt
14 changes: 14 additions & 0 deletions manage.py
@@ -0,0 +1,14 @@
#!/usr/bin/env python
from django.core.management import execute_manager
import imp
try:
imp.find_module('settings') # Assumed to be in the same directory.
except ImportError:
import sys
sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll have to run django-admin.py, passing it your settings module.\n" % __file__)
sys.exit(1)

import settings

if __name__ == "__main__":
execute_manager(settings)
Binary file added permabank.db
Binary file not shown.
5 changes: 0 additions & 5 deletions permabank.sh
@@ -1,11 +1,6 @@
#!/bin/env bash
# functions and aliases

# resets the app
function resetapp () {
python -c "import permabank;print permabank.reset() is None"
}

# starts a redis-cli session on epio-hosted instance
function epio-redis () {
epio run_command python -a permabank -- -c "\"from bundle_config import config;from subprocess import call;r=config['redis'];call(['redis-cli','-h',r['host'],'-p',r['port'],'-a',r['password']])\""
Expand Down
63 changes: 0 additions & 63 deletions permabank/__init__.py

This file was deleted.

41 changes: 0 additions & 41 deletions permabank/forms.py

This file was deleted.

13 changes: 0 additions & 13 deletions permabank/gravatars.py

This file was deleted.

86 changes: 0 additions & 86 deletions permabank/models.py

This file was deleted.

Binary file removed permabank/static/openid.png
Binary file not shown.
16 changes: 0 additions & 16 deletions permabank/static/permabank.js

This file was deleted.

0 comments on commit 731855b

Please sign in to comment.