-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
23 changed files
with
763 additions
and
3 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
__version__ = '0.1dev' |
Empty file.
Empty file.
83 changes: 83 additions & 0 deletions
83
examples/django/__PROJECT_NAME__/config/common/settings.py
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
""" | ||
{{ PROJECT_NAME }}.config.common.settings | ||
----------------------------------------- | ||
""" | ||
|
||
from os.path import abspath, join, dirname | ||
|
||
|
||
""" Paths """ | ||
SITE_ROOT = abspath(join(dirname(__file__), '..', '..')) | ||
PROJECT_ROOT = abspath(join(dirname(__file__), '..', '..')) | ||
MEDIA_ROOT = join(SITE_ROOT, 'media') | ||
STATICFILES_DIRS = [ | ||
join(PROJECT_ROOT, 'public'), ] | ||
LOG_ROOT = join(SITE_ROOT, 'logs') | ||
|
||
""" Urls """ | ||
STATIC_URL = '/s/' | ||
MEDIA_URL = '/m/' | ||
ROOT_URLCONF = '{{ PROJECT_NAME }}.urls' | ||
|
||
""" Secret Key & Site ID """ | ||
SITE_ID = 1 | ||
SECRET_KEY = '{{ DJANGO_SECRET_KEY }}' | ||
|
||
""" Location """ | ||
TIME_ZONE = 'Europe/London' | ||
LANGUAGE_CODE = 'en-gb' | ||
USE_I18N = True | ||
USE_L10N = True | ||
|
||
""" Templates """ | ||
TEMPLATE_DIRS = [join(PROJECT_ROOT, 'templates')] | ||
TEMPLATE_LOADERS = ( | ||
'django.template.loaders.filesystem.Loader', | ||
'django.template.loaders.app_directories.Loader', | ||
) | ||
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.static', | ||
'django.core.context_processors.request', | ||
'django.contrib.messages.context_processors.messages', | ||
'{{ PROJECT_NAME }}.context_processors.domain', | ||
) | ||
|
||
""" Middleware """ | ||
MIDDLEWARE_CLASSES = ( | ||
'django.middleware.cache.UpdateCacheMiddleware', | ||
'django.middleware.common.CommonMiddleware', | ||
'django.contrib.sessions.middleware.SessionMiddleware', | ||
'django.middleware.csrf.CsrfViewMiddleware', | ||
'django.contrib.auth.middleware.AuthenticationMiddleware', | ||
'django.contrib.messages.middleware.MessageMiddleware', | ||
'django.middleware.cache.FetchFromCacheMiddleware', | ||
) | ||
|
||
""" Installed Applications """ | ||
INSTALLED_APPS = ( | ||
# Django Apps | ||
'django.contrib.auth', | ||
'django.contrib.contenttypes', | ||
'django.contrib.sessions', | ||
'django.contrib.sites', | ||
'django.contrib.messages', | ||
'django.contrib.admin', | ||
'django.contrib.staticfiles', | ||
# Third Party Apps here | ||
# Project Apps here | ||
) | ||
|
||
""" Test Suite """ | ||
NOSE_ARGS = [ | ||
'--include=^(can|it|ensure|must|should|specs?|examples?)', | ||
'--with-spec', | ||
'--spec-color', | ||
'-s', | ||
'--with-coverage', | ||
'--cover-erase', | ||
'--cover-package={{ PROJECT_NAME }}'] | ||
TEST_RUNNER = 'django_nose.NoseTestSuiteRunner' |
Empty file.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# | ||
# Development Nginx Config | ||
# | ||
|
||
# Standard Port 80 | ||
server { | ||
|
||
listen 80; | ||
server_name _; # Catch all | ||
|
||
client_max_body_size 500M; | ||
|
||
access_log /var/log/nginx/{{ PROJECT_NAME }}.access.log combined; | ||
error_log /var/log/nginx/{{ PROJECT_NAME }}.error.log; | ||
|
||
location / { | ||
|
||
proxy_pass http://127.0.0.1:9000; | ||
proxy_set_header Host $http_host; | ||
proxy_set_header X-Real-IP $remote_addr; | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
|
||
} | ||
|
||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
""" | ||
{{ PROJECT_NAME }}.config.settings.dev | ||
-------------------------------------- | ||
""" | ||
|
||
from ..common.settings import * | ||
|
||
|
||
""" Debugging (default True for local environment) """ | ||
DEBUG = True | ||
TEMPLATE_DEBUG = DEBUG | ||
|
||
""" Databases (default is mysql) """ | ||
DATABASES = { | ||
'default': { | ||
'ENGINE': 'django.db.backends.mysql', | ||
'NAME': '{{ PROJECT_NAME }}', | ||
'USER': 'root', | ||
'PASSWORD': '', | ||
} | ||
} | ||
|
||
""" Cacheing (default is dummy, see django docs) """ | ||
CACHES = { | ||
'default': { | ||
'BACKEND': 'django.core.cache.backends.dummy.DummyCache', | ||
} | ||
} | ||
|
||
""" Use MD5 Password Hashing for Dev - Speeds things up """ | ||
PASSWORD_HASHERS = ['django.contrib.auth.hashers.MD5PasswordHasher'] |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
""" | ||
{{ PROJECT_NAME }}.context_processors | ||
------------------------------------- | ||
""" | ||
|
||
from django.conf import settings | ||
from django.contrib.sites.models import Site | ||
|
||
|
||
def domain(request): | ||
current_site = Site.objects.get_current() | ||
domain = getattr(settings, 'DOMAIN', 'http://%s' % current_site.domain) | ||
return { | ||
'DOMAIN': domain, | ||
'site': current_site, | ||
} |
Empty file.
Oops, something went wrong.