Commits

Jay Yu committed 0f5590f

settings revert back to Django 1.3.1
dev only settings file

Comments (0)

Files changed (4)

+# use glob syntax.
+syntax: glob
+
+*.pyc
+*.swp
+.DS_Store
+.fuse_hidden*
+._*
+db.sqlite3
+pythoncore

testproject/settings.py

+from __future__ import print_function
+
 # Django settings for testproject project.
 
 DEBUG = True
 TEMPLATE_DEBUG = DEBUG
 
 ADMINS = (
-    # ('Your Name', 'your_email@example.com'),
+    ('Jay Yu', 'qoo2004@gmail.com'),
 )
 
 MANAGERS = ADMINS
 
+import os
+PROJECT_PATH = os.path.realpath(os.path.dirname(__file__))
+
 DATABASES = {
     'default': {
-        'ENGINE': 'django.db.backends.', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
-        'NAME': '',                      # Or path to database file if using sqlite3.
+        'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
+        'NAME': os.path.join(PROJECT_PATH, 'db.sqlite3'), # Or path to database file if using sqlite3.
         'USER': '',                      # Not used with sqlite3.
         'PASSWORD': '',                  # Not used with sqlite3.
         'HOST': '',                      # Set to empty string for localhost. Not used with sqlite3.
 # 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 = 'Australia/Sydney'
 
 # Language code for this installation. All choices can be found here:
 # http://www.i18nguy.com/unicode/language-identifiers.html
 
 # Absolute filesystem path to the directory that will hold user-uploaded files.
 # Example: "/home/media/media.lawrence.com/media/"
-MEDIA_ROOT = ''
+MEDIA_ROOT = os.path.join(PROJECT_PATH, 'media')
 
 # URL that handles the media served from MEDIA_ROOT. Make sure to use a
 # trailing slash.
 # Don't put anything in this directory yourself; store your static files
 # in apps' "static/" subdirectories and in STATICFILES_DIRS.
 # Example: "/home/media/media.lawrence.com/static/"
-STATIC_ROOT = ''
+STATIC_ROOT = os.path.join(PROJECT_PATH, 'collected_static')
 
 # URL prefix for static files.
 # Example: "http://media.lawrence.com/static/"
 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 = (
     # Put strings here, like "/home/html/static" or "C:/www/django/static".
     # Always use forward slashes, even on Windows.
     # Don't forget to use absolute paths, not relative paths.
+    os.path.join(PROJECT_PATH, 'static/'),
 )
 
 # List of finder classes that know how to find static files in
 )
 
 # Make this unique, and don't share it with anybody.
-SECRET_KEY = '*2*teb^w+#!+0mqpt$ira8f6#11n(9yh$l8+g!4!a6=55d+)ui'
+SECRET_KEY = '*2*teb^w+#!+0mjj3$ira8f6#11n(1q84mfkne4]/.,4!a6=55d+)ui'
 
 # List of callables that know how to import templates from various sources.
 TEMPLATE_LOADERS = (
     'django.template.loaders.filesystem.Loader',
     'django.template.loaders.app_directories.Loader',
-#     'django.template.loaders.eggs.Loader',
+    'django.template.loaders.eggs.Loader',
 )
 
 MIDDLEWARE_CLASSES = (
+    'johnny.middleware.LocalStoreClearMiddleware',
+    'johnny.middleware.QueryCacheMiddleware',
+
     'django.middleware.common.CommonMiddleware',
     'django.contrib.sessions.middleware.SessionMiddleware',
     'django.middleware.csrf.CsrfViewMiddleware',
     # 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(PROJECT_PATH, 'templates'),
 )
 
 INSTALLED_APPS = (
     'django.contrib.messages',
     'django.contrib.staticfiles',
     # Uncomment the next line to enable the admin:
-    # 'django.contrib.admin',
+    'django.contrib.admin',
     # Uncomment the next line to enable admin documentation:
     # 'django.contrib.admindocs',
+    'gunicorn',
+    'johnny',
+    'mptt',
+    'piston',
+    'south',
+
+    'chitter',
+    'jlog',
 )
 
 # 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 when DEBUG=False.
+# 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,
-    'filters': {
-        'require_debug_false': {
-            '()': 'django.utils.log.CallbackFilter',
-            'callback': lambda r: not DEBUG
-        }
-    },
     'handlers': {
         'mail_admins': {
             'level': 'ERROR',
-            'filters': ['require_debug_false'],
             'class': 'django.utils.log.AdminEmailHandler'
         }
     },
         },
     }
 }
+
+CACHES = {
+    'default' : dict(
+        BACKEND = 'django.core.cache.backends.memcached.MemcachedCache',
+        LOCATION = ['127.0.0.1:11211'],
+        JOHNNY_CACHE = False,
+    ),
+
+    'johnny' : dict(
+        BACKEND = 'johnny.backends.memcached.MemcachedCache',
+        LOCATION = ['127.0.0.1:11211'],
+        JOHNNY_CACHE = True,
+    ),
+}
+
+JOHNNY_MIDDLEWARE_KEY_PREFIX='jc_'
+#JOHNNY_MIDDLEWARE_SECONDS=
+#MAN_IN_BLACKLIST=() 

testproject/settings_dev.py

+from settings import *
+
+try:
+    import devserver
+    INSTALLED_APPS += ('devserver', )
+
+    #DEVSERVER_ARGS =
+    #DEVSERVER_DEFAULT_ADDR = '127.0.0.1'
+    DEVSERVER_DEFAULT_PORT = '9999'
+    #DEVSERVER_WSGI_MIDDLEWARE
+    DEVSERVER_MODULES = (
+        'devserver.modules.sql.SQLRealTimeModule',
+        'devserver.modules.sql.SQLSummaryModule',
+        'devserver.modules.profile.ProfileSummaryModule',
+
+        # Modules not enabled by default
+        'devserver.modules.ajax.AjaxDumpModule',
+        #'devserver.modules.profile.MemoryUseModule',
+        'devserver.modules.cache.CacheSummaryModule',
+        #'devserver.modules.profile.LineProfilerModule',
+    )
+
+    DEVSERVER_IGNORED_PREFIXES = ['/media', '/uploads']
+except ImportError:
+    pass

testproject/urls.py

 from django.conf.urls.defaults import patterns, include, url
+from django.contrib import admin
+from django.views.generic.simple import direct_to_template
 
-# Uncomment the next two lines to enable the admin:
-# from django.contrib import admin
-# admin.autodiscover()
+from django.contrib.staticfiles.urls import staticfiles_urlpatterns
+
+
+# from tastypie.api import Api
+# 
+# from jlog.api import AuthorResource, EntryResource
+# 
+# # Tastypie
+# v1_api = Api(api_name='v1')
+# v1_api.register(AuthorResource())
+# v1_api.register(EntryResource())
+
+admin.autodiscover()
 
 urlpatterns = patterns('',
     # Examples:
     # url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
 
     # Uncomment the next line to enable the admin:
-    # url(r'^admin/', include(admin.site.urls)),
+    url(r'^admin/', include(admin.site.urls)),
+    url(r'^api/', include('api.urls')),
+    url(r'^blog/', include('jlog.urls')),
+    url(r'^$', direct_to_template, {'template': 'index.html'}),
+    url(r'^robots\.txt$', direct_to_template,
+        {'template': 'robots.txt'}, name='robots.txt'),
 )
+
+urlpatterns += staticfiles_urlpatterns()