Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add in a bunch of missing settings stuff, and cleanup some mistakes.

  • Loading branch information...
commit 894e3d89b383f9c18c50dc553d35dd0e723c1bf0 1 parent d676cd5
@xenith authored
View
6 manage.py
@@ -3,11 +3,9 @@
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "{{ project_name }}.settings")
+ # Add the lib/ directory to the system path
+ sys.path.append("lib")
from django.core.management import execute_from_command_line
- # Set a global variable for the project root
- global PROJECT_ROOT
- PROJECT_ROOT = os.path.dirname(os.path.abspath(__file__))
-
execute_from_command_line(sys.argv)
View
85 project_name/settings/base.py
@@ -1,7 +1,11 @@
# This is your project's main settings file that can be committed to your
# repo. If you need to override a setting locally, use local.py
import os
-#import memcache_toolbar.panels.memcache
+import memcache_toolbar.panels.memcache
+import logging
+
+# Your project root
+PROJECT_ROOT = os.path.abspath(os.path.dirname(__file__) + "../../../")
# Bundles is a dictionary of two dictionaries, css and js, which list css files
# and js files that can be bundled together by the minify app.
@@ -30,7 +34,15 @@
# Defines the views served for root URLs.
ROOT_URLCONF = '{{ project_name }}.urls'
-INSTALLED_APPS = list(INSTALLED_APPS) + [
+INSTALLED_APPS = [
+ # Template apps
+ 'jingo_minify',
+
+ # Django contrib apps
+ 'django.contrib.auth',
+ 'django_sha2', # Load after auth to monkey-patch it.
+ 'django.contrib.contenttypes',
+ 'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.admin',
@@ -39,15 +51,30 @@
'django.contrib.humanize',
'django.contrib.syndication',
'django.contrib.staticfiles',
+
+ # Third-party apps, patches, fixes
+ 'commonware.response.cookies',
+ 'djcelery',
+ 'django_nose',
+ 'session_csrf',
'debug_toolbar',
- 'debug_toolbar_htmltidy',
'debug_toolbar_user_panel',
'memcache_toolbar',
# Application base, containing global templates.
'{{ project_name }}.base',
+
+ # Local apps, referenced via {{ project_name }}.appname
]
+# Sessions
+#
+# By default, be at least somewhat secure with our session cookies.
+SESSION_COOKIE_HTTPONLY = True
+
+## Tests
+TEST_RUNNER = 'test_utils.runner.RadicalTestSuiteRunner'
+
# Absolute filesystem path to the directory that will hold user-uploaded files.
# Example: "/home/media/media.example.com/media/"
MEDIA_ROOT = os.path.join(PROJECT_ROOT, 'media')
@@ -74,6 +101,14 @@
# Don't forget to use absolute paths, not relative paths.
)
+# If you set this to False, Django will make some optimizations so as not
+# to load the internationalization machinery.
+USE_I18N = True
+
+# If you set this to False, Django will not format dates, numbers and
+# calendars according to the current locale
+USE_L10N = True
+
# List of finder classes that know how to find static files in
# various locations.
STATICFILES_FINDERS = (
@@ -82,14 +117,35 @@
# 'django.contrib.staticfiles.finders.DefaultStorageFinder',
)
-MIDDLEWARE_CLASSES = list(MIDDLEWARE_CLASSES) + [
+MIDDLEWARE_CLASSES = [
+ 'django.middleware.common.CommonMiddleware',
+ 'django.contrib.sessions.middleware.SessionMiddleware',
+ 'django.contrib.auth.middleware.AuthenticationMiddleware',
+ 'session_csrf.CsrfMiddleware', # Must be after auth middleware.
+ 'django.contrib.messages.middleware.MessageMiddleware',
+ 'commonware.middleware.FrameOptionsHeader',
'debug_toolbar.middleware.DebugToolbarMiddleware',
]
-TEMPLATE_CONTEXT_PROCESSORS = list(TEMPLATE_CONTEXT_PROCESSORS) + [
+TEMPLATE_CONTEXT_PROCESSORS = [
+ 'django.contrib.auth.context_processors.auth',
+ 'django.core.context_processors.debug',
+ 'django.core.context_processors.media',
+ 'django.core.context_processors.request',
+ 'session_csrf.context_processor',
+ 'django.contrib.messages.context_processors.messages',
+ #'funfactory.context_processors.i18n',
+ #'funfactory.context_processors.globals',
+ #'jingo_minify.helpers.build_ids',
'django.core.context_processors.static',
]
+# List of callables that know how to import templates from various sources.
+TEMPLATE_LOADERS = (
+ 'jingo.Loader',
+ 'django.template.loaders.filesystem.Loader',
+ 'django.template.loaders.app_directories.Loader',
+)
def custom_show_toolbar(request):
return request.user.is_superuser
@@ -108,7 +164,6 @@ def custom_show_toolbar(request):
'debug_toolbar_user_panel.panels.UserPanel',
'memcache_toolbar.panels.memcache.MemcachePanel',
'debug_toolbar.panels.version.VersionDebugPanel',
- 'debug_toolbar_htmltidy.panels.HTMLTidyDebugPanel',
'debug_toolbar.panels.timer.TimerDebugPanel',
'debug_toolbar.panels.settings_vars.SettingsVarsDebugPanel',
'debug_toolbar.panels.headers.HeaderDebugPanel',
@@ -129,25 +184,7 @@ def custom_show_toolbar(request):
JINGO_EXCLUDE_APPS = [
'admin',
'debug_toolbar',
- 'debug_toolbar_htmltidy',
'debug_toolbar_user_panel',
'memcache_toolbar',
]
-# Tells the extract script what files to look for L10n in and what function
-# handles the extraction. The Tower library expects this.
-
-# # Use this if you have localizable HTML files:
-# DOMAIN_METHODS['lhtml'] = [
-# ('**/templates/**.lhtml',
-# 'tower.management.commands.extract.extract_tower_template'),
-# ]
-
-# # Use this if you have localizable HTML files:
-# DOMAIN_METHODS['javascript'] = [
-# # Make sure that this won't pull in strings from external libraries you
-# # may use.
-# ('media/js/**.js', 'javascript'),
-# ]
-
-LOGGING = dict(loggers=dict({{ project_name }}={'level': logging.DEBUG}))
View
1  project_name/urls.py
@@ -14,7 +14,6 @@ def bad(request):
(r'^admin/doc/', include('django.contrib.admindocs.urls')),
(r'^admin/$', anonymous_csrf(admin.site.admin_view(admin.site.index))),
(r'^admin/', include(admin.site.urls)),
- url(r'^', include('debug_toolbar_htmltidy.urls')),
url(r'^', include('debug_toolbar_user_panel.urls')),
(r'^bad/$', bad),
)
View
2  requirements/prod.txt
@@ -23,7 +23,7 @@ django-celery
# L10n
Babel>=0.9.4
--e git://github.com/clouserw/tower.git#egg=tower
+#-e git://github.com/clouserw/tower.git#egg=tower
# Caching
python-memcached==1.48
Please sign in to comment.
Something went wrong with that request. Please try again.