summaryrefslogtreecommitdiff
path: root/example_project
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@peacefrogs.net>2012-02-15 19:57:33 +0100
committerÉtienne Loks <etienne.loks@peacefrogs.net>2012-02-15 19:57:33 +0100
commit053c3a9a421a980a2af2f8e60df2d0c106b959e7 (patch)
tree7eafee9ba4a8db2c5e470f599939cab18f4c22d7 /example_project
parentfbfae775970eb0b29c3ac3f79d5bcd7c9acb12fb (diff)
downloadChimère-053c3a9a421a980a2af2f8e60df2d0c106b959e7.tar.bz2
Chimère-053c3a9a421a980a2af2f8e60df2d0c106b959e7.zip
Use staticfiles (refs #315)
Diffstat (limited to 'example_project')
-rw-r--r--example_project/settings.py.example50
-rw-r--r--example_project/urls.py2
2 files changed, 51 insertions, 1 deletions
diff --git a/example_project/settings.py.example b/example_project/settings.py.example
index 2715d02..c9a3934 100644
--- a/example_project/settings.py.example
+++ b/example_project/settings.py.example
@@ -10,6 +10,7 @@ ROOT_PATH = os.path.realpath(os.path.dirname(__file__)) + "/"
EXTRA_URL = 'chimere/'
BASE_URL = SERVER_URL + EXTRA_URL
EMAIL_HOST = 'localhost'
+STATIC_URL = '/static/'
TINYMCE_URL = 'http://localhost/tinymce/'
JQUERY_URL = "/chimere/static/jquery/jquery-1.4.4.min.js"
@@ -147,6 +148,7 @@ INSTALLED_APPS = (
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
+ 'django.contrib.staticfiles',
'south',
'chimere',
# activate it if you want to use migration scripts
@@ -157,3 +159,51 @@ INSTALLED_APPS = (
if 'chimere_rss' in INSTALLED_APPS:
TEMPLATE_DIRS.append(ROOT_PATH + 'chimere_rss/templates')
+
+LOGGING = {'version': 1,
+ 'disable_existing_loggers': False,
+ 'handlers': {
+ /# Include the default Django email handler for errors
+ # This is what you'd get without configuring logging at all.
+ 'mail_admins': {
+ 'class': 'django.utils.log.AdminEmailHandler',
+ 'level': 'ERROR',
+ # But the emails are plain text by default - HTML is nicer
+ 'include_html': True,
+ },
+ # Log to a text file that can be rotated by logrotate
+ 'logfile': {
+ 'class': 'logging.handlers.WatchedFileHandler',
+ 'filename': '/var/log/django/chimere.log'
+ },
+ },
+ 'loggers': {
+ # Again, default Django configuration to email unhandled exceptions
+ 'django.request': {
+ 'handlers': ['mail_admins'],
+ 'level': 'ERROR',
+ 'propagate': True,
+ },
+ # Might as well log any errors anywhere else in Django
+ 'django': {
+ 'handlers': ['logfile'],
+ 'level': 'ERROR',
+ 'propagate': False,
+ },
+ # Your own app - this assumes all your logger names start with "myapp."
+ 'main': {
+ 'handlers': ['logfile'],
+ 'level': 'WARNING', # Or maybe INFO or DEBUG
+ 'propogate': False
+ },
+ },
+}
+
+TEMPLATE_CONTEXT_PROCESSORS = (
+ 'django.core.context_processors.debug',
+ 'django.core.context_processors.i18n',
+ 'django.core.context_processors.media',
+ 'django.core.context_processors.static',
+ 'django.contrib.auth.context_processors.auth',
+ 'django.contrib.messages.context_processors.messages',
+)
diff --git a/example_project/urls.py b/example_project/urls.py
index 84a7e13..1f95694 100644
--- a/example_project/urls.py
+++ b/example_project/urls.py
@@ -33,7 +33,7 @@ urlpatterns += staticfiles_urlpatterns()
urlpatterns += patterns('',
(r'^admin/doc/', include('django.contrib.admindocs.urls')),
(r'^admin/', include(admin.site.urls)),
- url(r'^chimere/', include('chimere.urls', namespace="chimere")),
+ url(r'^', include('chimere.urls', namespace="chimere")),
)
if 'rss' in settings.INSTALLED_APPS: