Permalink
Browse files

Directory for templates, apps, static files, and setting file with co…

…nfiguration for Django running
  • Loading branch information...
1 parent c5e67f0 commit 374be37a9738ffe51b52d44cc53b82e73e3a7a12 @kachayev committed Jul 30, 2011
Showing with 65 additions and 17 deletions.
  1. 0 apps/.gitkeep
  2. +65 −17 settings.py
  3. 0 static/.gitkeep
  4. 0 templates/.gitkeep
View
No changes.
View
@@ -1,10 +1,14 @@
-# Django settings for gearoscope project.
+import os, sys
+
+WORKDIR = os.path.dirname(__file__)
+sys.path.append(os.path.join(WORKDIR, 'apps'))
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
- # ('Your Name', 'your_email@domain.com'),
+ ('Alexey Kachayev', 'kachayev@gmail.com'),
+ ('Iurii Ogienko', 'iurii.ogiienko@gmail.com'),
)
MANAGERS = ADMINS
@@ -20,14 +24,16 @@
}
}
+SESSION_ENGINE = 'django.contrib.sessions.backends.cached_db'
+
# 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.
# On Unix systems, a value of None will cause Django to use the same
# timezone as the operating system.
# If running in a Windows environment this must be set to the same as your
# system time zone.
-TIME_ZONE = 'America/Chicago'
+TIME_ZONE = 'Europe/Kiev'
# Language code for this installation. All choices can be found here:
# http://www.i18nguy.com/unicode/language-identifiers.html
@@ -44,18 +50,41 @@
USE_L10N = True
# Absolute filesystem path to the directory that will hold user-uploaded files.
-# Example: "/home/media/media.lawrence.com/"
-MEDIA_ROOT = ''
+MEDIA_ROOT = os.path.join(WORKDIR, 'static', 'media')
# URL that handles the media served from MEDIA_ROOT. Make sure to use a
-# trailing slash if there is a path component (optional in other cases).
-# Examples: "http://media.lawrence.com", "http://example.com/media/"
-MEDIA_URL = ''
+# trailing slash.
+MEDIA_URL = '/static/media/'
# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
# trailing slash.
# Examples: "http://foo.com/media/", "/media/".
-ADMIN_MEDIA_PREFIX = '/media/'
+ADMIN_MEDIA_PREFIX = '/static/admin'
+
+# Absolute path to the directory static files should be collected to.
+# Don't put anything in this directory yourself; store your static files
+# in apps' "static/" subdirectories and in STATICFILES_DIRS.
+COMMON_STATIC_ROOT = os.path.join(WORKDIR, 'static')
+STATIC_ROOT = ''
+
+# URL prefix for static files.
+STATIC_URL = '/static/'
+
+# URL prefix for admin static files -- CSS, JavaScript and images.
+# Make sure to use a trailing slash.
+# Examples: "http://foo.com/static/admin/", "/static/admin/".
+ADMIN_MEDIA_PREFIX = '/static/admin/'
+
+# Additional locations of static files
+STATICFILES_DIRS = (COMMON_STATIC_ROOT,)
+
+# List of finder classes that know how to find static files in
+# various locations.
+STATICFILES_FINDERS = (
+ 'django.contrib.staticfiles.finders.FileSystemFinder',
+ 'django.contrib.staticfiles.finders.AppDirectoriesFinder',
+)
+
# Make this unique, and don't share it with anybody.
SECRET_KEY = 'rl5*7@(s^7b!hc&t-&970e9zq37f9@cqcnd#kd42&fd_2gi2x8'
@@ -64,7 +93,6 @@
TEMPLATE_LOADERS = (
'django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader',
-# 'django.template.loaders.eggs.Loader',
)
MIDDLEWARE_CLASSES = (
@@ -78,9 +106,7 @@
ROOT_URLCONF = 'gearoscope.urls'
TEMPLATE_DIRS = (
- # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
- # Always use forward slashes, even on Windows.
- # Don't forget to use absolute paths, not relative paths.
+ os.path.join(WORKDIR, 'templates')
)
INSTALLED_APPS = (
@@ -89,8 +115,30 @@
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
- # Uncomment the next line to enable the admin:
- # 'django.contrib.admin',
- # Uncomment the next line to enable admin documentation:
- # 'django.contrib.admindocs',
+ 'django.contrib.staticfiles',
+ 'django.contrib.admin',
)
+
+# A sample logging configuration. The only tangible logging
+# performed by this configuration is to send an email to
+# the site admins on every HTTP 500 error.
+# See http://docs.djangoproject.com/en/dev/topics/logging for
+# more details on how to customize your logging configuration.
+LOGGING = {
+ 'version': 1,
+ 'disable_existing_loggers': False,
+ 'handlers': {
+ 'mail_admins': {
+ 'level': 'ERROR',
+ 'class': 'django.utils.log.AdminEmailHandler'
+ }
+ },
+ 'loggers': {
+ 'django.request': {
+ 'handlers': ['mail_admins'],
+ 'level': 'ERROR',
+ 'propagate': True,
+ },
+ }
+}
+
View
No changes.
View
No changes.

0 comments on commit 374be37

Please sign in to comment.