config.py 3.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. # This configuration was automatically generated by install.sh
  2. from os.path import dirname, join as path_join
  3. # -*- Mode: Python; tab-width: 4; indent-tabs-mode: nil; coding: utf-8; -*-
  4. # This configuration file specifies the global setup of the brat
  5. # server. It is recommended that you use the installation script
  6. # instead of editing this file directly. To do this, run the following
  7. # command in the brat directory:
  8. #
  9. # ./install.sh
  10. #
  11. # if you wish to configure the server manually, you will first need to
  12. # make sure that this file appears as config.py in the brat server
  13. # root directory. If this file is currently named config_template.py,
  14. # you can do this as follows:
  15. #
  16. # cp config_template.py config.py
  17. #
  18. # you will then need to edit config.py, minimally replacing all
  19. # instances of the string CHANGE_ME with their appropriate values.
  20. # Please note that these values MUST appear in quotes, e.g. as in
  21. #
  22. # ADMIN_CONTACT_EMAIL = 'admin'
  23. # Contact email for users to use if the software encounters errors
  24. ADMIN_CONTACT_EMAIL = 'admin'
  25. # Directories required by the brat server:
  26. #
  27. # BASE_DIR: directory in which the server is installed
  28. # DATA_DIR: directory containing texts and annotations
  29. # WORK_DIR: directory that the server uses for temporary files
  30. #
  31. BASE_DIR = dirname(__file__)
  32. DATA_DIR = path_join(BASE_DIR, 'data')
  33. WORK_DIR = path_join(BASE_DIR, 'work')
  34. # If you have installed brat as suggested in the installation
  35. # instructions, you can set up BASE_DIR, DATA_DIR and WORK_DIR by
  36. # removing the three lines above and deleting the initial '#'
  37. # character from the following four lines:
  38. #from os.path import dirname, join
  39. #BASE_DIR = dirname(__file__)
  40. #DATA_DIR = path_join(BASE_DIR, 'data')
  41. #WORK_DIR = path_join(BASE_DIR, 'work')
  42. # To allow editing, include at least one USERNAME:PASSWORD pair below.
  43. # The format is the following:
  44. #
  45. # 'USERNAME': 'PASSWORD',
  46. #
  47. # For example, user `editor` and password `annotate`:
  48. #
  49. # 'editor': 'annotate',
  50. USER_PASSWORD = {
  51. 'admin': 'admin',
  52. # (add USERNAME:PASSWORD pairs below this line.)
  53. }
  54. ########## ADVANCED CONFIGURATION OPTIONS ##########
  55. # The following options control advanced aspects of the brat server
  56. # setup. It is not necessary to edit these in a basic brat server
  57. # installation.
  58. # MAX_SEARCH_RESULT_NUMBER
  59. # It may be a good idea to limit the max number of results to a search
  60. # as very high numbers can be demanding of both server and clients.
  61. # (unlimited if not defined or <= 0)
  62. MAX_SEARCH_RESULT_NUMBER = 1000
  63. # DEBUG
  64. # Set to True to enable additional debug output
  65. DEBUG = False
  66. # TUTORIALS
  67. # Unauthorised users can create tutorials (but not edit without a login)
  68. TUTORIALS = False
  69. # LOG_LEVEL
  70. # If you are a developer you may want to turn on extensive server
  71. # logging by enabling LOG_LEVEL = LL_DEBUG
  72. LL_DEBUG, LL_INFO, LL_WARNING, LL_ERROR, LL_CRITICAL = list(range(5))
  73. LOG_LEVEL = LL_WARNING
  74. #LOG_LEVEL = LL_DEBUG
  75. # BACKUP_DIR
  76. # Define to enable backups
  77. # from os.path import join
  78. #BACKUP_DIR = join(WORK_DIR, 'backup')
  79. try:
  80. assert DATA_DIR != BACKUP_DIR, 'DATA_DIR cannot equal BACKUP_DIR'
  81. except NameError:
  82. pass # BACKUP_DIR most likely not defined
  83. # SVG_CONVERSION_COMMANDS
  84. # If export to formats other than SVG is needed, the server must have
  85. # a software capable of conversion like inkscape set up, and the
  86. # following must be defined.
  87. # (SETUP NOTE: at least Inkscape 0.46 requires the directory
  88. # ".gnome2/" in the apache home directory and will crash if it doesn't
  89. # exist.)
  90. # SVG_CONVERSION_COMMANDS = [
  91. # ('png', 'inkscape --export-area-drawing --without-gui --file=%s --export-png=%s'),
  92. # ('pdf', 'inkscape --export-area-drawing --without-gui --file=%s --export-pdf=%s'),
  93. # ('eps', 'inkscape --export-area-drawing --without-gui --file=%s --export-eps=%s'),
  94. # ]