diff options
Diffstat (limited to 'bitbake/lib/toaster/toastermain')
| -rw-r--r-- | bitbake/lib/toaster/toastermain/settings.py | 7 | ||||
| -rw-r--r-- | bitbake/lib/toaster/toastermain/settings_test.py | 4 |
2 files changed, 6 insertions, 5 deletions
diff --git a/bitbake/lib/toaster/toastermain/settings.py b/bitbake/lib/toaster/toastermain/settings.py index 69aa5a10c0..3c12359366 100644 --- a/bitbake/lib/toaster/toastermain/settings.py +++ b/bitbake/lib/toaster/toastermain/settings.py | |||
| @@ -148,6 +148,8 @@ STATICFILES_FINDERS = ( | |||
| 148 | # Make this unique, and don't share it with anybody. | 148 | # Make this unique, and don't share it with anybody. |
| 149 | SECRET_KEY = 'NOT_SUITABLE_FOR_HOSTED_DEPLOYMENT' | 149 | SECRET_KEY = 'NOT_SUITABLE_FOR_HOSTED_DEPLOYMENT' |
| 150 | 150 | ||
| 151 | TMPDIR = os.environ.get('TOASTER_DJANGO_TMPDIR', '/tmp') | ||
| 152 | |||
| 151 | class InvalidString(str): | 153 | class InvalidString(str): |
| 152 | def __mod__(self, other): | 154 | def __mod__(self, other): |
| 153 | from django.template.base import TemplateSyntaxError | 155 | from django.template.base import TemplateSyntaxError |
| @@ -214,7 +216,7 @@ CACHES = { | |||
| 214 | # }, | 216 | # }, |
| 215 | 'default': { | 217 | 'default': { |
| 216 | 'BACKEND': 'django.core.cache.backends.filebased.FileBasedCache', | 218 | 'BACKEND': 'django.core.cache.backends.filebased.FileBasedCache', |
| 217 | 'LOCATION': '/tmp/toaster_cache_%d' % os.getuid(), | 219 | 'LOCATION': '%s/toaster_cache_%d' % (TMPDIR, os.getuid()), |
| 218 | 'TIMEOUT': 1, | 220 | 'TIMEOUT': 1, |
| 219 | } | 221 | } |
| 220 | } | 222 | } |
| @@ -312,7 +314,7 @@ for t in os.walk(os.path.dirname(currentdir)): | |||
| 312 | LOGGING = LOGGING_SETTINGS | 314 | LOGGING = LOGGING_SETTINGS |
| 313 | 315 | ||
| 314 | # Build paths inside the project like this: BASE_DIR / 'subdir'. | 316 | # Build paths inside the project like this: BASE_DIR / 'subdir'. |
| 315 | BUILDDIR = os.environ.get("BUILDDIR", "/tmp") | 317 | BUILDDIR = os.environ.get("BUILDDIR", TMPDIR) |
| 316 | 318 | ||
| 317 | # LOG VIEWER | 319 | # LOG VIEWER |
| 318 | # https://pypi.org/project/django-log-viewer/ | 320 | # https://pypi.org/project/django-log-viewer/ |
| @@ -325,7 +327,6 @@ LOG_VIEWER_PATTERNS = ['INFO', 'DEBUG', 'WARNING', 'ERROR', 'CRITICAL'] | |||
| 325 | # Optionally you can set the next variables in order to customize the admin: | 327 | # Optionally you can set the next variables in order to customize the admin: |
| 326 | LOG_VIEWER_FILE_LIST_TITLE = "Logs list" | 328 | LOG_VIEWER_FILE_LIST_TITLE = "Logs list" |
| 327 | 329 | ||
| 328 | |||
| 329 | if DEBUG and SQL_DEBUG: | 330 | if DEBUG and SQL_DEBUG: |
| 330 | LOGGING['loggers']['django.db.backends'] = { | 331 | LOGGING['loggers']['django.db.backends'] = { |
| 331 | 'level': 'DEBUG', | 332 | 'level': 'DEBUG', |
diff --git a/bitbake/lib/toaster/toastermain/settings_test.py b/bitbake/lib/toaster/toastermain/settings_test.py index 6538d9e453..74def2d240 100644 --- a/bitbake/lib/toaster/toastermain/settings_test.py +++ b/bitbake/lib/toaster/toastermain/settings_test.py | |||
| @@ -19,10 +19,10 @@ TEMPLATE_DEBUG = DEBUG | |||
| 19 | DATABASES = { | 19 | DATABASES = { |
| 20 | 'default': { | 20 | 'default': { |
| 21 | 'ENGINE': 'django.db.backends.sqlite3', | 21 | 'ENGINE': 'django.db.backends.sqlite3', |
| 22 | 'NAME': '/tmp/toaster-test-db.sqlite', | 22 | 'NAME': '%s/toaster-test-db.sqlite' % TMPDIR, |
| 23 | 'TEST': { | 23 | 'TEST': { |
| 24 | 'ENGINE': 'django.db.backends.sqlite3', | 24 | 'ENGINE': 'django.db.backends.sqlite3', |
| 25 | 'NAME': '/tmp/toaster-test-db.sqlite', | 25 | 'NAME': '%s/toaster-test-db.sqlite' % TMPDIR, |
| 26 | } | 26 | } |
| 27 | } | 27 | } |
| 28 | } | 28 | } |
