예제 #1
0
# Django settings for example project.

# Setup a ``project_dir`` function
import os
from dj_settings_helpers import create_project_dir
project_dir = create_project_dir(os.path.join(os.path.dirname(__file__),
        '..', '..'))

DEBUG = True
TEMPLATE_DEBUG = DEBUG

ADMINS = (
    # ('Your Name', '*****@*****.**'),
)

MANAGERS = ADMINS

import dj_database_url
DATABASE_URL = os.environ.get('DATABASE_URL',
        'sqlite:///%s' % project_dir('project.db'))
DATABASES = {'default': dj_database_url.parse(DATABASE_URL), }

# Local time zone for this installation. Choices can be found here:
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
# although not all choices may be available on all operating systems.
# In a Windows environment this must be set to your system time zone.
TIME_ZONE = 'America/Chicago'

# Language code for this installation. All choices can be found here:
# http://www.i18nguy.com/unicode/language-identifiers.html
LANGUAGE_CODE = 'en-us'
예제 #2
0
 def test_can_combine_multiple_paths(self):
     project_dir = create_project_dir('/foo/settings.py')
     expected = self.generate_expected_path('foo', 'templates', 'config')
     self.assertEqual(expected, project_dir('templates', 'config'))
예제 #3
0
 def test_returns_a_function(self):
     f = create_project_dir('foo')
     self.assertTrue(type(f) is types.FunctionType)
예제 #4
0
 def test_returned_function_returns_path(self):
     project_dir = create_project_dir('/foo/settings.py')
     expected = self.generate_expected_path('foo', 'templates')
     self.assertEqual(expected, project_dir('templates'))
예제 #5
0
# Django settings for example project.

# Setup a ``project_dir`` function
import os
from dj_settings_helpers import create_project_dir
project_dir = create_project_dir(os.path.join(os.path.dirname(__file__),
        '..', '..'))

DEBUG = True
TEMPLATE_DEBUG = DEBUG

ADMINS = (
    # ('Your Name', '*****@*****.**'),
)

MANAGERS = ADMINS

import dj_database_url
DATABASE_URL = os.environ.get('DATABASE_URL',
        'sqlite:///%s' % project_dir('project.db'))
DATABASES = {'default': dj_database_url.parse(DATABASE_URL), }

# Local time zone for this installation. Choices can be found here:
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
# although not all choices may be available on all operating systems.
# In a Windows environment this must be set to your system time zone.
TIME_ZONE = 'America/Chicago'

# Language code for this installation. All choices can be found here:
# http://www.i18nguy.com/unicode/language-identifiers.html
LANGUAGE_CODE = 'en-us'