~widelands-dev/widelands-website/trunk

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
#!/usr/bin/python
# -*- coding: utf-8 -*-
# The above leads python2.7 to read this file as utf-8
# Needs to be directly after the python shebang

# Treat all strings as unicode
from __future__ import unicode_literals
import os
import re

bd = os.getcwd() # Better make this a static path

STATIC_MEDIA_PATH = os.path.join(bd, 'media')
MEDIA_ROOT = os.path.join(bd, 'media/')


# If you are using the developer version of widelands from Launchpad
# set WIDELANDS_SVN_DIR to the correct path. See also:
# https://wl.widelands.org/wiki/BzrPrimer/
WIDELANDS_SVN_DIR = "/path/to/widelands/trunk/"

os.environ['PATH'] = WIDELANDS_SVN_DIR + ':' + os.environ['PATH']

DATABASES = {
   'default': {
      'ENGINE': 'django.db.backends.sqlite3',
      'NAME': 'dev.db',
      'USER': '',      # Not used with sqlite3.
      'PASSWORD': '',  # Not used with sqlite3.
      'HOST': '',      # Set to empty string for localhost. Not used with sqlite3.
      'PORT': '',      # Set to empty string for default. Not used with sqlite3.
      # Next is only used for mysql. Explanations:
      # https://docs.djangoproject.com/en/1.11/ref/databases/#connecting-to-the-database
      # 'init_command': is recommended for MySQL >= 5.6
      # 'OPTIONS': {
      #   'init_command': "SET sql_mode='STRICT_TRANS_TABLES'",
      #   'isolation_level': 'read committed',
      #},
   }
}

# The following are just dummy values, but needed defined
# To use the registration you have to create an API key pair
# See https://developers.google.com/recaptcha/docs/start
# You have to use 'localhost' as Domain
NORECAPTCHA_SITE_KEY = 'dummy'
NORECAPTCHA_SECRET_KEY = 'dummy'

# The logo used for mainpage
LOGO_FILE = 'logo_alpha.png'

# Setting an email backend prevents 'connection refused' errors
# Don't use this on the widelands server!
# This Backend shows Emails in console
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'

# Anti spam keywords
# If these are found, the posts/topics in forum get hidden
ANTI_SPAM_KWRDS = ['spam']
ANTI_SPAM_PHONE_NR = re.compile('\d{8,16}')
MAX_HIDDEN_POSTS = 5

#######################
#  Optional settings  #
#######################

# Set a Database cache. You won't need this for development or testing locally.
# If you want to use this, run ./manage.py createcachetable after uncommenting.
# CACHES = {
#     'default': {
#         'BACKEND': 'django.core.cache.backends.db.DatabaseCache',
#         'LOCATION': 'wl_cache',
#     }
# }

# Uncomment 'LOGGING = {...}' for debugging purposes when you have set DEBUG=False.
# Use then in the code:

# import logging
# log = logging.getLogger(__name__)
# log.info('Variable x: %s', x)

# This prints the value for Variable 'x' to log.txt

#LOGGING = {
#    'version': 1,
#    'disable_existing_loggers': False,
#    'handlers': {
#        'logfile': {
#            'level':'DEBUG',
#            'class':'logging.FileHandler',
#            'filename': bd + "/log.txt",
#        },
#    },
#    'root': {
#        'level': 'INFO',
#        'handlers': ['logfile']
#    },
#}