Move django_project -> django/basic/

This commit is contained in:
Eryn Wells 2012-11-15 13:28:47 -08:00
parent 65ecc6f6e5
commit 0cbeea2103
11 changed files with 0 additions and 0 deletions

View file

@ -0,0 +1,3 @@
DATABASE_URL=sqlite://localhost/local.db
SECRET_KEY={{ secret_key }}
DEBUG=True

View file

@ -0,0 +1,18 @@
MANAGEPY=honcho run -- env/bin/python manage.py
update:
virtualenv env
env/bin/pip install -r requirements.txt
$(MANAGEPY) syncdb
migrate:
$(MANAGEPY) migrate
run: update
$(MANAGEPY) runserver 0.0.0.0:8000
shell: update
$(MANAGEPY) shell
deploy:
git push heroku master

View file

@ -0,0 +1 @@
web: python manage.py run_gunicorn -w4 -b 0.0.0.0:$PORT

View file

@ -0,0 +1,8 @@
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)

View file

@ -0,0 +1,3 @@
from django.db import models
# Create your models here.

View file

@ -0,0 +1,16 @@
"""
This file demonstrates writing tests using the unittest module. These will pass
when you run "manage.py test".
Replace this with more appropriate tests for your application.
"""
from django.test import TestCase
class SimpleTest(TestCase):
def test_basic_addition(self):
"""
Tests that 1 + 1 always equals 2.
"""
self.assertEqual(1 + 1, 2)

View file

@ -0,0 +1 @@
# Create your views here.

View file

@ -0,0 +1,3 @@
Django==1.4.1
dj-database-url==0.2.1
virtualenv==1.7.2

View file

@ -0,0 +1,111 @@
# Settings for {{ project_name }}.
import os
PROJECT_DIR = os.path.abspath(os.path.dirname(__file__))
DEBUG = os.environ.get('DEBUG', False)
TEMPLATE_DEBUG = DEBUG
ADMINS = ()
MANAGERS = ADMINS
import dj_database_url
DATABASES = {'default': dj_database_url.config()}
SITE_ID = 1
LANGUAGE_CODE = 'en-us'
USE_I18N = True
USE_L10N = True
USE_TZ = True
TIME_ZONE = 'America/Los_Angeles'
MEDIA_ROOT = os.path.join(PROJECT_DIR, 'media')
MEDIA_URL = '/media/'
STATIC_ROOT = os.path.join(PROJECT_DIR, 'collected-static')
STATIC_URL = '/static/'
STATICFILES_DIRS = (
os.path.join(PROJECT_DIR, 'static'),
)
STATICFILES_FINDERS = (
'django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
)
TEMPLATE_LOADERS = (
'django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader',
)
MIDDLEWARE_CLASSES = (
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
)
TEMPLATE_CONTEXT_PROCESSORS = (
'django.contrib.auth.context_processors.auth',
'django.core.context_processors.i18n',
'django.core.context_processors.request',
'django.core.context_processors.media',
'django.core.context_processors.static',
'django.contrib.messages.context_processors.messages',
)
ROOT_URLCONF = 'urls'
TEMPLATE_DIRS = (
os.path.join(PROJECT_DIR, 'templates'),
)
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
# Custom apps below here.
'{{ project_name }}',
)
if DEBUG:
INSTALLED_APPS += ('django.contrib.admin',)
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'handlers': {
'console': {
'level': 'DEBUG' if DEBUG else 'INFO',
'class': 'logging.StreamHandler',
},
},
'loggers': {
'': {
'handlers': ['console'],
'level': 'INFO',
'propagate': True,
},
'{{ project_name }}': {
'handlers': ['console'],
'level': 'DEBUG' if DEBUG else 'INFO',
'propagate': True,
},
}
}
#
# Environment
#
assert 'SECRET_KEY' in os.environ, 'Set SECRET_KEY in your .env file!'
SECRET_KEY = os.environ['SECRET_KEY']

View file

@ -0,0 +1,16 @@
from django.conf import settings
from django.conf.urls import patterns, include, url
urlpatterns = patterns('',
url(r'', include('{{ project_name }}.urls')),
)
if settings.DEBUG:
from django.contrib import admin
admin.autodiscover()
urlpatterns += patterns('',
url(r'^admin/', include(admin.site.urls)),
)