src/hdabo/config.py.tmpl
author rougeronj
Thu, 20 Nov 2014 15:11:27 +0100
changeset 367 7b0fc4cbed2e
parent 275 b2eb3e9e6956
child 359 46ad324f6fe4
permissions -rw-r--r--
Update Django translation files
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
896db0083b76 first commit
ymh <ymh.work@gmail.com>
parents:
diff changeset
     1
import os
896db0083b76 first commit
ymh <ymh.work@gmail.com>
parents:
diff changeset
     2
896db0083b76 first commit
ymh <ymh.work@gmail.com>
parents:
diff changeset
     3
BASE_DIR = os.path.dirname(os.path.abspath(__file__)).rstrip("/")+"/"
270
0f8c8b16cb58 close unwanted head
cavaliet
parents: 266
diff changeset
     4
BASE_URL = '/hdabo/'
0
896db0083b76 first commit
ymh <ymh.work@gmail.com>
parents:
diff changeset
     5
WEB_URL = 'http://localhost'
896db0083b76 first commit
ymh <ymh.work@gmail.com>
parents:
diff changeset
     6
896db0083b76 first commit
ymh <ymh.work@gmail.com>
parents:
diff changeset
     7
# Absolute filesystem path to the directory that will hold user-uploaded files.
896db0083b76 first commit
ymh <ymh.work@gmail.com>
parents:
diff changeset
     8
# Example: "/home/media/media.lawrence.com/media/"
896db0083b76 first commit
ymh <ymh.work@gmail.com>
parents:
diff changeset
     9
MEDIA_ROOT = os.path.abspath(BASE_DIR + "../static/media/")
896db0083b76 first commit
ymh <ymh.work@gmail.com>
parents:
diff changeset
    10
896db0083b76 first commit
ymh <ymh.work@gmail.com>
parents:
diff changeset
    11
# URL that handles the media served from MEDIA_ROOT. Make sure to use a
896db0083b76 first commit
ymh <ymh.work@gmail.com>
parents:
diff changeset
    12
# trailing slash.
896db0083b76 first commit
ymh <ymh.work@gmail.com>
parents:
diff changeset
    13
# Examples: "http://media.lawrence.com/media/", "http://example.com/media/"
896db0083b76 first commit
ymh <ymh.work@gmail.com>
parents:
diff changeset
    14
MEDIA_URL = BASE_URL + "static/media/"
896db0083b76 first commit
ymh <ymh.work@gmail.com>
parents:
diff changeset
    15
896db0083b76 first commit
ymh <ymh.work@gmail.com>
parents:
diff changeset
    16
# Absolute path to the directory static files should be collected to.
896db0083b76 first commit
ymh <ymh.work@gmail.com>
parents:
diff changeset
    17
# Don't put anything in this directory yourself; store your static files
896db0083b76 first commit
ymh <ymh.work@gmail.com>
parents:
diff changeset
    18
# in apps' "static/" subdirectories and in STATICFILES_DIRS.
896db0083b76 first commit
ymh <ymh.work@gmail.com>
parents:
diff changeset
    19
# Example: "/home/media/media.lawrence.com/static/"
275
b2eb3e9e6956 first step of folder administration
cavaliet
parents: 273
diff changeset
    20
STATIC_ROOT = os.path.abspath(BASE_DIR + "../../web/static/site/")
0
896db0083b76 first commit
ymh <ymh.work@gmail.com>
parents:
diff changeset
    21
896db0083b76 first commit
ymh <ymh.work@gmail.com>
parents:
diff changeset
    22
# URL prefix for static files.
896db0083b76 first commit
ymh <ymh.work@gmail.com>
parents:
diff changeset
    23
# Example: "http://media.lawrence.com/static/"
896db0083b76 first commit
ymh <ymh.work@gmail.com>
parents:
diff changeset
    24
STATIC_URL = BASE_URL + "static/site/"
896db0083b76 first commit
ymh <ymh.work@gmail.com>
parents:
diff changeset
    25
896db0083b76 first commit
ymh <ymh.work@gmail.com>
parents:
diff changeset
    26
# Additional locations of static files
896db0083b76 first commit
ymh <ymh.work@gmail.com>
parents:
diff changeset
    27
STATICFILES_DIRS = (
896db0083b76 first commit
ymh <ymh.work@gmail.com>
parents:
diff changeset
    28
    # Put strings here, like "/home/html/static" or "C:/www/django/static".
896db0083b76 first commit
ymh <ymh.work@gmail.com>
parents:
diff changeset
    29
    # Always use forward slashes, even on Windows.
896db0083b76 first commit
ymh <ymh.work@gmail.com>
parents:
diff changeset
    30
    # Don't forget to use absolute paths, not relative paths.
896db0083b76 first commit
ymh <ymh.work@gmail.com>
parents:
diff changeset
    31
)
896db0083b76 first commit
ymh <ymh.work@gmail.com>
parents:
diff changeset
    32
896db0083b76 first commit
ymh <ymh.work@gmail.com>
parents:
diff changeset
    33
896db0083b76 first commit
ymh <ymh.work@gmail.com>
parents:
diff changeset
    34
DATABASES = {
896db0083b76 first commit
ymh <ymh.work@gmail.com>
parents:
diff changeset
    35
    'default': {
896db0083b76 first commit
ymh <ymh.work@gmail.com>
parents:
diff changeset
    36
        'ENGINE': 'django.db.backends.postgresql_psycopg2', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
896db0083b76 first commit
ymh <ymh.work@gmail.com>
parents:
diff changeset
    37
        'NAME': 'hdabo',                      # Or path to database file if using sqlite3.
896db0083b76 first commit
ymh <ymh.work@gmail.com>
parents:
diff changeset
    38
        'USER': 'iri',                      # Not used with sqlite3.
896db0083b76 first commit
ymh <ymh.work@gmail.com>
parents:
diff changeset
    39
        'PASSWORD': 'iri',                  # Not used with sqlite3.
896db0083b76 first commit
ymh <ymh.work@gmail.com>
parents:
diff changeset
    40
        'HOST': 'localhost',                      # Set to empty string for localhost. Not used with sqlite3.
896db0083b76 first commit
ymh <ymh.work@gmail.com>
parents:
diff changeset
    41
        'PORT': '5432',                      # Set to empty string for default. Not used with sqlite3.
896db0083b76 first commit
ymh <ymh.work@gmail.com>
parents:
diff changeset
    42
    }
896db0083b76 first commit
ymh <ymh.work@gmail.com>
parents:
diff changeset
    43
}
896db0083b76 first commit
ymh <ymh.work@gmail.com>
parents:
diff changeset
    44
273
0fa407857df2 update config template
cavaliet
parents: 272
diff changeset
    45
0fa407857df2 update config template
cavaliet
parents: 272
diff changeset
    46
266
825ff4d6a8ac reorganise folders and update venv dependancies (django, etc...)
cavaliet
parents: 176
diff changeset
    47
HAYSTACK_CONNECTIONS = {
825ff4d6a8ac reorganise folders and update venv dependancies (django, etc...)
cavaliet
parents: 176
diff changeset
    48
    'default': {
273
0fa407857df2 update config template
cavaliet
parents: 272
diff changeset
    49
        # the elasticsearch_backend is probably temporary
266
825ff4d6a8ac reorganise folders and update venv dependancies (django, etc...)
cavaliet
parents: 176
diff changeset
    50
        #'ENGINE': 'hdabo.search.french_whoosh_backend.SearchBackend',
825ff4d6a8ac reorganise folders and update venv dependancies (django, etc...)
cavaliet
parents: 176
diff changeset
    51
        'ENGINE': 'haystack.backends.elasticsearch_backend.ElasticsearchSearchEngine',
273
0fa407857df2 update config template
cavaliet
parents: 272
diff changeset
    52
        'URL': 'http://127.0.0.1:9200/',
0fa407857df2 update config template
cavaliet
parents: 272
diff changeset
    53
        'INDEX_NAME': 'hdabo',
266
825ff4d6a8ac reorganise folders and update venv dependancies (django, etc...)
cavaliet
parents: 176
diff changeset
    54
    },
825ff4d6a8ac reorganise folders and update venv dependancies (django, etc...)
cavaliet
parents: 176
diff changeset
    55
}
11
143ab88d17f8 add ordered manytomany fields and indexing
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    56
273
0fa407857df2 update config template
cavaliet
parents: 272
diff changeset
    57
0fa407857df2 update config template
cavaliet
parents: 272
diff changeset
    58
LOG_FILE = os.path.abspath(os.path.join(BASE_DIR,"../../run/log/log.txt"))
0fa407857df2 update config template
cavaliet
parents: 272
diff changeset
    59
LOG_LEVEL = logging.DEBUG
0fa407857df2 update config template
cavaliet
parents: 272
diff changeset
    60
LOGGING = {
0fa407857df2 update config template
cavaliet
parents: 272
diff changeset
    61
    'version': 1,
0fa407857df2 update config template
cavaliet
parents: 272
diff changeset
    62
    'disable_existing_loggers': False,
0fa407857df2 update config template
cavaliet
parents: 272
diff changeset
    63
    'formatters' : {
0fa407857df2 update config template
cavaliet
parents: 272
diff changeset
    64
        'simple' : {
0fa407857df2 update config template
cavaliet
parents: 272
diff changeset
    65
            'format': "%(asctime)s - %(levelname)s : %(message)s",
0fa407857df2 update config template
cavaliet
parents: 272
diff changeset
    66
        },
0fa407857df2 update config template
cavaliet
parents: 272
diff changeset
    67
        'semi-verbose': {
0fa407857df2 update config template
cavaliet
parents: 272
diff changeset
    68
            'format': '%(levelname)s %(asctime)s %(module)s %(message)s'
0fa407857df2 update config template
cavaliet
parents: 272
diff changeset
    69
        },                    
0fa407857df2 update config template
cavaliet
parents: 272
diff changeset
    70
    },
0fa407857df2 update config template
cavaliet
parents: 272
diff changeset
    71
    'handlers': {
0fa407857df2 update config template
cavaliet
parents: 272
diff changeset
    72
        'mail_admins': {
0fa407857df2 update config template
cavaliet
parents: 272
diff changeset
    73
            'level': 'ERROR',
0fa407857df2 update config template
cavaliet
parents: 272
diff changeset
    74
            'class': 'django.utils.log.AdminEmailHandler'
0fa407857df2 update config template
cavaliet
parents: 272
diff changeset
    75
        },
0fa407857df2 update config template
cavaliet
parents: 272
diff changeset
    76
        'stream_to_console': {
0fa407857df2 update config template
cavaliet
parents: 272
diff changeset
    77
            'level': LOG_LEVEL,
0fa407857df2 update config template
cavaliet
parents: 272
diff changeset
    78
            'class': 'logging.StreamHandler'
0fa407857df2 update config template
cavaliet
parents: 272
diff changeset
    79
        },
0fa407857df2 update config template
cavaliet
parents: 272
diff changeset
    80
        'file': {
0fa407857df2 update config template
cavaliet
parents: 272
diff changeset
    81
            'level': LOG_LEVEL,
0fa407857df2 update config template
cavaliet
parents: 272
diff changeset
    82
            'class': 'logging.FileHandler',
0fa407857df2 update config template
cavaliet
parents: 272
diff changeset
    83
            'filename': LOG_FILE,
0fa407857df2 update config template
cavaliet
parents: 272
diff changeset
    84
            'formatter': 'semi-verbose',
0fa407857df2 update config template
cavaliet
parents: 272
diff changeset
    85
        },
0fa407857df2 update config template
cavaliet
parents: 272
diff changeset
    86
    }            ,
0fa407857df2 update config template
cavaliet
parents: 272
diff changeset
    87
    'loggers': {
0fa407857df2 update config template
cavaliet
parents: 272
diff changeset
    88
        'hdabo': {
0fa407857df2 update config template
cavaliet
parents: 272
diff changeset
    89
            'handlers': ['file'],
0fa407857df2 update config template
cavaliet
parents: 272
diff changeset
    90
            'level': LOG_LEVEL,
0fa407857df2 update config template
cavaliet
parents: 272
diff changeset
    91
            'propagate': True,
0fa407857df2 update config template
cavaliet
parents: 272
diff changeset
    92
        },
0fa407857df2 update config template
cavaliet
parents: 272
diff changeset
    93
        'hdalab': {
0fa407857df2 update config template
cavaliet
parents: 272
diff changeset
    94
            'handlers': ['file'],
0fa407857df2 update config template
cavaliet
parents: 272
diff changeset
    95
            'level': LOG_LEVEL,
0fa407857df2 update config template
cavaliet
parents: 272
diff changeset
    96
            'propagate': True,
0fa407857df2 update config template
cavaliet
parents: 272
diff changeset
    97
        },
0fa407857df2 update config template
cavaliet
parents: 272
diff changeset
    98
#         'django.db.backends':{
0fa407857df2 update config template
cavaliet
parents: 272
diff changeset
    99
#             'handlers': ['file'],
0fa407857df2 update config template
cavaliet
parents: 272
diff changeset
   100
#             'level': LOG_LEVEL,
0fa407857df2 update config template
cavaliet
parents: 272
diff changeset
   101
#             'propagate': True,
0fa407857df2 update config template
cavaliet
parents: 272
diff changeset
   102
#         },
0fa407857df2 update config template
cavaliet
parents: 272
diff changeset
   103
#         'django.request': {
0fa407857df2 update config template
cavaliet
parents: 272
diff changeset
   104
#             'handlers': ['file'],
0fa407857df2 update config template
cavaliet
parents: 272
diff changeset
   105
#             'level': LOG_LEVEL,
0fa407857df2 update config template
cavaliet
parents: 272
diff changeset
   106
#             'propagate': True,
0fa407857df2 update config template
cavaliet
parents: 272
diff changeset
   107
#         },
0fa407857df2 update config template
cavaliet
parents: 272
diff changeset
   108
    }
0fa407857df2 update config template
cavaliet
parents: 272
diff changeset
   109
}