Permalink
Browse files

Initial project layout

  • Loading branch information...
stephenmcd committed Jul 30, 2011
1 parent 96d6d8d commit 95ed90b9f0d3bdb6e01f5ff45a9e34337b70b7ec
Showing with 205 additions and 1 deletion.
  1. +7 −0 .hgignore
  2. 0 __init__.py
  3. +10 −0 conf/supervisord.conf
  4. 0 core/__init__.py
  5. +40 −0 fabfile.py
  6. +0 −1 humor
  7. +16 −0 manage.py
  8. +12 −0 requirements.txt
  9. +98 −0 settings.py
  10. +6 −0 templates/base.html
  11. +5 −0 templates/index.html
  12. +11 −0 urls.py
View
@@ -0,0 +1,7 @@
syntax: glob
*.pyc
*.pyo
*.db
.DS_Store
.coverage
local_settings.py
View
No changes.
View
@@ -0,0 +1,10 @@
[group:drawnby]
programs=drawnby_app
[program:drawnby_app]
command=python manage.py runserver
directory=/home/dash/drawnby/
user=nobody
autostart=true
autorestart=true
View
No changes.
View
@@ -0,0 +1,40 @@
import os
from fabric.api import *
PROJECT_DIRNAME = "/home/dash/%s" % os.path.dirname(os.path.abspath(
__file__)).split(os.sep)[-1]
env.user = "dash"
env.hosts = ["drawnby.jupo.org"]
def push():
local("hg push")
def pull():
with cd(PROJECT_DIRNAME):
run("hg pull")
run("hg up -C")
def migrate():
with cd(PROJECT_DIRNAME):
run("python manage.py syncdb")
run("python manage.py migrate")
def install():
with cd(PROJECT_DIRNAME):
sudo("pip install -r requirements.txt")
def restart():
with cd(PROJECT_DIRNAME):
run("supervisorctl restart drawnby:drawnby_app")
def deploy():
push()
pull()
install()
migrate()
restart()
View
1 humor

This file was deleted.

Oops, something went wrong.
View
@@ -0,0 +1,16 @@
#!/usr/bin/env python
from django.core.management import execute_manager
try:
import 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.\n"
"You'll have to run django-admin.py, passing it your settings module.\n"
"(If the file settings.py does indeed exist, it's causing an "
"ImportError somehow.)\n" % __file__)
sys.exit(1)
if __name__ == "__main__":
execute_manager(settings)
View
@@ -0,0 +1,12 @@
Django==1.3
django-social-auth==0.3.16
South==0.7.3
django-extensions==0.6
django-compressor==0.9.2
easy-thumbnails==1.0-alpha-17
django-pagination==1.0.7
supervisor==3.0a10
elementtree==1.2.7-20070827-preview
gevent==0.13.6
hg+https://bitbucket.org/Jeffrey/gevent-websocket@stable#egg=gevent-websocket
hg+https://bitbucket.org/Jeffrey/gevent-socketio#egg=gevent-socketio
View
@@ -0,0 +1,98 @@
TIME_ZONE = "Australia/Melbourne"
TEMPLATE_DEBUG = True
DEBUG = True
SESSION_EXPIRE_AT_BROWSER_CLOSE = True
SITE_ID = 1
USE_I18N = False
SECRET_KEY = "SRGF45gR45wtg$%G$RGt4tFTG%t6rsfbvsfdvBSR"
INTERNAL_IPS = ("127.0.0.1", "60.241.76.198")
TEMPLATE_LOADERS = (
"django.template.loaders.filesystem.Loader",
"django.template.loaders.app_directories.Loader",
)
DATABASES = {
"default": {
"ENGINE": "sqlite3",
"NAME": "drawnby.db",
"USER": "",
"PASSWORD": "",
"HOST": "",
"PORT": "",
}
}
import os, sys
PROJECT_ROOT = os.path.dirname(os.path.abspath(__file__))
if PROJECT_ROOT not in sys.path:
sys.path.insert(0, PROJECT_ROOT)
full_path = lambda *parts: os.path.join(PROJECT_ROOT, *parts)
PROJECT_DIRNAME = PROJECT_ROOT.split(os.sep)[-1]
ADMIN_MEDIA_PREFIX = "/media/"
MEDIA_URL = "/static/"
MEDIA_ROOT = full_path(MEDIA_URL.strip("/"))
ROOT_URLCONF = "urls"
TEMPLATE_DIRS = full_path("templates")
INSTALLED_APPS = (
"django.contrib.admin",
"django.contrib.auth",
"django.contrib.contenttypes",
"django.contrib.messages",
"django.contrib.sessions",
"django.contrib.sites",
"django_extensions",
"social_auth",
"easy_thumbnails",
"south",
"pagination",
"compressor",
"core",
)
TEMPLATE_CONTEXT_PROCESSORS = (
"django.contrib.auth.context_processors.auth",
"django.core.context_processors.debug",
"django.core.context_processors.i18n",
"django.core.context_processors.media",
"django.core.context_processors.request",
"django.contrib.messages.context_processors.messages",
)
MIDDLEWARE_CLASSES = (
"django.contrib.sessions.middleware.SessionMiddleware",
"django.contrib.auth.middleware.AuthenticationMiddleware",
"django.middleware.common.CommonMiddleware",
"django.middleware.csrf.CsrfViewMiddleware",
"django.contrib.messages.middleware.MessageMiddleware",
"pagination.middleware.PaginationMiddleware",
)
MESSAGE_STORAGE = "django.contrib.messages.storage.cookie.CookieStorage"
AUTHENTICATION_BACKENDS = (
'social_auth.backends.twitter.TwitterBackend',
'social_auth.backends.facebook.FacebookBackend',
'django.contrib.auth.backends.ModelBackend',
)
TWITTER_CONSUMER_KEY = ""
TWITTER_CONSUMER_SECRET = ""
FACEBOOK_APP_ID = ""
FACEBOOK_API_SECRET = ""
FACEBOOK_EXTENDED_PERMISSIONS = ["email", "offline_access", "publish_stream"]
LOGIN_URL = '/auth/'
LOGIN_REDIRECT_URL = '/auth/loggedin/'
LOGIN_ERROR_URL = '/auth/error/'
COMPRESS = True
COMPRESS_OUTPUT_DIR = "cache"
try:
from local_settings import *
except ImportError:
pass
View
@@ -0,0 +1,6 @@
<html>
<head></head>
<body>
{% block main %}{% endblock %}
</body>
</html>
View
@@ -0,0 +1,5 @@
{% extends "base.html" %}
{% block main %}
drawnby homepage
{% endblock %}
View
11 urls.py
@@ -0,0 +1,11 @@
from django.conf.urls.defaults import *
from django.conf import settings
from django.views.generic.simple import direct_to_template
urlpatterns = patterns("",
url("^$", direct_to_template, {"template": "index.html"}, name="home"),
("^%s/(?P<path>.*)$" % settings.MEDIA_URL.strip("/"),
"django.views.static.serve", {"document_root": settings.MEDIA_ROOT}),
)

0 comments on commit 95ed90b

Please sign in to comment.