1. webriders
  2. django-template-project

Commits

Rostyslav Bryzgunov  committed 0bf6e62

README's refactoring and clean-up

  • Participants
  • Parent commits fce6487
  • Branches default

Comments (0)

Files changed (32)

File media/README.txt

View file
-This folder is for user-generated content. 
-We strongly suggest to "svn:ignore *" it (if you're using SVN).
+This folder is for user-generated content.
+We strongly recommend to VCS-ignore it.

File source/apps/README.txt

View file
-Project-specific Django applications container.
+Project-specific Django applications.
 Use "ext" subfolder to include third-party applications.

File source/apps/ext/README.txt

View file
-Django external applications SOURCE CODE.
-If you want to make changes - make a copy into "apps" (parent dir).
-
-This folder should contain UNCHANGED third-party apps code. Probably subfolders here may be:
-* filebrowser/
-* admin_tools/
-* debug_toolbar/
-* ... (other thitd-party apps)
-
-You may use svn:externals (if you use SVN) to prevent copy-paste. Here is an example of our svn:externals:
-
-south            %SERVER%/django-south/tags/0.7.1/south
-debug_toolbar    %SERVER%/django-debug-toolbar/tags/version-0.8.3/debug_toolbar
-filebrowser      %SERVER%/django-filebrowser/branches/no-grapelli-3.0
-tinymce          %SERVER%/django-tinymce/branches/googlecode-trunk-r102-patched/tinymce
-localeurl        %SERVER%/django-localeurl/tags/version-1.4/localeurl
-admin_tools      %SERVER%/django-admin-tools/tags/0.3.0/admin_tools
-rosetta          %SERVER%/i18n/django-rosetta/tags/0.5.6/rosetta
-modeltranslation %SERVER%/i18n/django-modeltranslation/trunk/modeltranslation
-
-Note, that %SERVER% is our secret SVN hosting and we won't tell it :)
+Project's external Django applications.
+This folder and all its contents should be READ-ONLY.
+If you want to make changes - make a copy into "apps" (parent dir).

File source/conf/apps/__init__.py

Empty file added.

File source/conf/staticfinders.py

View file
+from django.core.files.storage import FileSystemStorage
+from django.contrib.staticfiles.finders import BaseStorageFinder
+from django.conf import settings
+
+
+class StaticRootFinder(BaseStorageFinder):
+    storage = FileSystemStorage(settings.STATIC_ROOT, settings.STATIC_URL)

File source/db/README.txt

View file
 DB folder. 
-Our SQLite files are stored here. 
-But you may also place here some SQL scripts, alters, dumps, etc.
-
-We suggest you to ignore all your *.sqlite files stored here (if you'll use SQLite too):
-  svn:ignore
-  *.sqlite
+You may place here some SQL scripts, alters, dumps, etc.

File source/db/local.sqlite

Binary file removed.

File source/lib/README.txt

View file
-Container for project-specific libs (not django-apps)
+Project-specific Python libs (not django-apps).
+Use "ext" subfolder to include third-party libs.

File source/lib/ext/README.txt

View file
+Project's external Python libs.
+This folder and all its contents should be READ-ONLY.
+If you want to make changes - make a copy into "lib" (parent dir).

File source/lib/ext/__init__.py

Empty file added.

File source/scripts/compile_messages.bat

-cd ../apps/web
-echo off
-echo --------------------------------------------------
-echo Compile i18n messages
-echo --------------------------------------------------
-python ../../manage.py compilemessages

File source/scripts/db/dump_db.bat

View file
+cd ../../
+echo --------------------------------------------------
+echo Dump whole project data in json format
+echo --------------------------------------------------
+python manage.py dumpdata --format=json --indent=4 > db/all.json

File source/scripts/db/init_db.bat

View file
+cd ../../
+echo --------------------------------------------------
+echo Sync DB
+echo --------------------------------------------------
+python manage.py syncdb

File source/scripts/db/load_db.bat

View file
+cd ../../
+echo --------------------------------------------------
+echo Load saved dump into db
+echo --------------------------------------------------
+python manage.py reset --noinput auth contenttypes sites sessions web
+python manage.py loaddata db/all.json

File source/scripts/dump_db.bat

-cd ..
-echo off
-echo --------------------------------------------------
-echo Dump whole project data in json format
-echo --------------------------------------------------
-python manage.py dumpdata --format=json --indent=4 > db/all.json

File source/scripts/i18n/compile_messages.bat

View file
+cd ../../apps/web/
+echo off
+echo --------------------------------------------------
+echo Compile i18n messages
+echo --------------------------------------------------
+python ../../manage.py compilemessages

File source/scripts/i18n/make_messages.bat

View file
+cd ../../apps/web/
+echo off
+echo --------------------------------------------------
+echo Make i18n messages
+echo --------------------------------------------------
+python ../../manage.py makemessages -l en
+

File source/scripts/load_db.bat

-cd ..
-echo off
-echo --------------------------------------------------
-echo Load saved dump into db
-echo --------------------------------------------------
-python manage.py reset
-python manage.py reset --noinput auth contenttypes sites sessions web
-python manage.py loaddata db/all.json

File source/scripts/make_messages.bat

-cd ../apps/web
-echo off
-echo --------------------------------------------------
-echo Make i18n messages
-echo --------------------------------------------------
-python ../../manage.py makemessages -l en
-

File source/scripts/migrate.bat

-cd ..
-echo off
-echo --------------------------------------------------
-echo Migrate database
-echo --------------------------------------------------
-python manage.py schemamigration web --auto
-python manage.py migrate web

File source/scripts/py_shell.bat

-cd ..
-echo off
-echo --------------------------------------------------
-echo Python Shell
-echo --------------------------------------------------
-python manage.py shell

File source/scripts/run_dev_server.bat

View file
+cd ..
+echo --------------------------------------------------
+echo Start development server
+echo --------------------------------------------------
+rem . /srv/python-environments/django-site/bin/activate
+python manage.py runserver 80

File source/scripts/run_devserver.bat

-cd ..
-echo off
-echo --------------------------------------------------
-echo Start development server
-echo --------------------------------------------------
-python manage.py runserver 80

File source/scripts/south/south_auto.bat

View file
+cd ../../
+echo off
+echo --------------------------------------------------
+echo Create schema migration and apply it
+echo --------------------------------------------------
+python manage.py schemamigration web --auto
+python manage.py migrate web

File source/scripts/south/south_init.bat

View file
+cd ../../
+echo off
+echo --------------------------------------------------
+echo Init South control for not south-controlled app
+echo --------------------------------------------------
+python manage.py schemamigration web --initial
+python manage.py migrate web

File source/scripts/south/south_migrate.bat

View file
+cd ../../
+echo off
+echo --------------------------------------------------
+echo Migrate database (run all migrations)
+echo --------------------------------------------------
+python manage.py migrate

File source/scripts/south/south_schemamigration.bat

View file
+cd ../../
+echo off
+echo --------------------------------------------------
+echo Create schema migration
+echo --------------------------------------------------
+python manage.py schemamigration web --auto

File source/scripts/south_auto.bat

-cd ..
-echo off
-echo --------------------------------------------------
-echo Create migrations
-echo --------------------------------------------------
-python manage.py schemamigration web --auto

File source/scripts/south_init.bat

-cd ..
-echo off
-echo --------------------------------------------------
-echo Init South control for not south-controlled app
-echo --------------------------------------------------
-python manage.py schemamigration web --initial
-python manage.py syncdb --migrate

File source/scripts/south_migrate.bat

-cd ..
-echo off
-echo --------------------------------------------------
-echo Migrate database (run all migrations)
-echo --------------------------------------------------
-python manage.py migrate 

File source/scripts/sync_db.bat

-cd ..
-echo off
-echo --------------------------------------------------
-echo Sync DB
-echo --------------------------------------------------
-python manage.py syncdb --migrate
-

File source/settings/main_settings.py

View file
-#!/usr/bin/python
 # -*- coding: UTF-8 -*-
+# Django settings for project.
 
-# Django settings for project.
 import os
 import sys
+import admin_tools
 
 # Debug settings
 DEBUG = False
 TEMPLATE_DEBUG = DEBUG
 
 # Force removal of fastcgi script name from URL
-FORCE_SCRIPT_NAME=""
+FORCE_SCRIPT_NAME = ""
 
-# We are in "project/trunk/code/" folder. We need to get PROJECT_ROOT
+# We are inside "source" folder now. We need to get parent dir - the PROJECT_ROOT
 PROJECT_ROOT = os.path.abspath('..')
 
-sys.path.insert(0, os.path.abspath(os.path.join(PROJECT_ROOT, 'source/')))
-sys.path.insert(0, os.path.abspath(os.path.join(PROJECT_ROOT, 'source/apps')))
-sys.path.insert(0, os.path.abspath(os.path.join(PROJECT_ROOT, 'source/apps/ext')))
-sys.path.insert(0, os.path.abspath(os.path.join(PROJECT_ROOT, 'source/lib')))
-sys.path.insert(0, os.path.abspath(os.path.join(PROJECT_ROOT, 'source/lib/ext')))
+sys.path.insert(0, os.path.abspath('apps'))
+sys.path.insert(0, os.path.abspath(os.path.join('apps', 'ext')))
+sys.path.insert(0, os.path.abspath('lib'))
+sys.path.insert(0, os.path.abspath(os.path.join('lib', 'ext')))
 
-ADMINS = [
+ADMINS = (
      ('Alerts', 'alert@example.com'),
-]
-MANAGERS = [
-     ('Info', 'info@example.com'),
-]
-if not DEBUG:
-    pass
+)
 
-EMAIL_HOST = ''
-EMAIL_PORT = ''
-EMAIL_HOST_USER = ''
-EMAIL_HOST_PASSWORD = ''
-EMAIL_USE_TLS = True
-EMAIL_SUBJECT_PREFIX = ' '
+MANAGERS = ADMINS
 
-
-# DB settings will be overrided
-#DATABASES = {
-#    'default': {}
-#}
+# DB settings will be overridden
+#DATABASES = {}
 
 # 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 = 'Europe/Kiev'
+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'
-
-#LANGUAGES = (
-#             ('ru', u'Русский'),
-#             ('en', u'English'),
-#             ('uk', u'Український'),
-#             )
-#
+LANGUAGE_CODE = 'en-us'
 
 SITE_ID = 1
 
 # If you set this to False, Django will make some optimizations so as not
 # to load the internationalization machinery.
-USE_I18N = True
+USE_I18N = False
+
+# If you set this to False, Django will not format dates, numbers and
+# calendars according to the current locale
 USE_L10N = True
-# Absolute path to the directory that holds media.
-# Example: "/home/media/media.lawrence.com/"
-MEDIA_ROOT = os.path.join(PROJECT_ROOT, "media")
+
+# Absolute filesystem path to the directory that will hold user-uploaded files.
+# Example: "/home/media/media.lawrence.com/media/"
+MEDIA_ROOT = os.path.abspath(os.path.join(PROJECT_ROOT, "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/"
+# trailing slash.
+# Examples: "http://media.lawrence.com/media/", "http://example.com/media/"
 MEDIA_URL = '/media/'
 
-STATIC_ROOT = os.path.join(PROJECT_ROOT, "static")
+# 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.
+# Example: "/home/media/media.lawrence.com/static/"
+STATIC_ROOT = os.path.abspath(os.path.join(PROJECT_ROOT, "static"))
 
+# URL prefix for static files.
+# Example: "http://media.lawrence.com/static/"
 STATIC_URL = '/static/'
 
-# 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 = '/adminmedia/'
-ADMIN_MEDIA_ROOT = os.path.join(PROJECT_ROOT, 'adminmedia') 
+# 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.
+    # Example for admin_tools (until they'll move "media" to "static")
+    #("ext", os.path.join(admin_tools.__path__[0], "media")),
+)
+
+# 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',
+    'conf.staticfinders.StaticRootFinder',
+)
 
 # Make this unique, and don't share it with anybody.
-SECRET_KEY = 'c^7$)t^ka7oe+z6nfw)#$10auo=_$5oqv%6@nhhzm%k5s$1mxr'
+SECRET_KEY = '+hf(*)n6qwq#-0er!j$6y$zp2&2lb_k2a!t&6ksw0+)j8+)ly='
 
 # List of callables that know how to import templates from various sources.
 TEMPLATE_LOADERS = (
-    'django.template.loaders.filesystem.load_template_source',
-    'django.template.loaders.app_directories.load_template_source',
+    'django.template.loaders.filesystem.Loader',
+    'django.template.loaders.app_directories.Loader',
+#     'django.template.loaders.eggs.Loader',
 )
 
 MIDDLEWARE_CLASSES = (
     'django.middleware.common.CommonMiddleware',
     'django.contrib.sessions.middleware.SessionMiddleware',
+    'django.middleware.csrf.CsrfViewMiddleware',
     'django.contrib.auth.middleware.AuthenticationMiddleware',
+    'django.contrib.messages.middleware.MessageMiddleware',
 )
 
 ROOT_URLCONF = 'urls'
 
 TEMPLATE_DIRS = (
-    # We don't use global template dirs
-)
-
-# Default list of context processors
-TEMPLATE_CONTEXT_PROCESSORS = (
-    'django.core.context_processors.auth',
-    'django.core.context_processors.debug',
-    'django.core.context_processors.i18n',
-    'django.core.context_processors.media',
-    'django.contrib.messages.context_processors.messages',
-    'django.core.context_processors.request',
+    # 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.
 )
 
 INSTALLED_APPS = (
     'django.contrib.contenttypes',
     'django.contrib.sessions',
     #'django.contrib.sites',
+    'django.contrib.messages',
+    'django.contrib.staticfiles',
     'django.contrib.admin',
 )
 
-INTERNAL_IPS = ('127.0.0.1', 'localhost', 'django.local')
+# 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,
+        },
+    }
+}
+
+INTERNAL_IPS = ('127.0.0.1', 'localhost')