askrobots / foxray Public

Foxray: a light error tracker for the Sentry SDKs. Runs inside Django (the admin is the UI) or on its own; SQLite or Postgres, nothing else. Not affiliated with Sentry.

0 downloads

foxray/tests/django_settings.py
Download zip
Clone
Clone with git
git clone https://gitstable.com/git/askrobots/foxray.git
HTTPS
https://gitstable.com/git/askrobots/foxray.git
SSH
ssh://git@gitstable.com:2222/askrobots/foxray.git

Cloning needs no sign-in. Pushing over HTTPS asks for your username and an access token. SSH needs your key under SSH keys.

danq9 0.1.2: the first PyPI release (v0.1.1 is already tagged at 05cc354, before the PyPI metadata) 58507e3 4 weeks ago History
django_settings.py · 2.1 KB · 45 lines
1import os
2import tempfile
3from urllib.parse import urlsplit
4
5SECRET_KEY = "foxray-tests"
6DEBUG = False
7ALLOWED_HOSTS = ["*"]
8USE_TZ = True
9TIME_ZONE = "UTC"
10INSTALLED_APPS = [
11 "django.contrib.admin", "django.contrib.auth", "django.contrib.contenttypes", "django.contrib.sessions",
12 "django.contrib.messages", "foxray.django",
13]
14MIDDLEWARE = [
15 "django.middleware.security.SecurityMiddleware",
16 "django.contrib.sessions.middleware.SessionMiddleware",
17 "django.middleware.common.CommonMiddleware",
18 "django.middleware.csrf.CsrfViewMiddleware",
19 "django.contrib.auth.middleware.AuthenticationMiddleware",
20 "django.contrib.messages.middleware.MessageMiddleware",
21]
22ROOT_URLCONF = "tests.django_urls"
23TEMPLATES = [{
24 "BACKEND": "django.template.backends.django.DjangoTemplates", "APP_DIRS": True,
25 "OPTIONS": {"context_processors": ["django.template.context_processors.request",
26 "django.contrib.auth.context_processors.auth",
27 "django.contrib.messages.context_processors.messages"]},
28}]
29_pg = os.environ.get("FOXRAY_TEST_DJANGO_PG", "")
30if _pg:
31 _u = urlsplit(_pg)
32 DATABASES = {"default": {"ENGINE": "django.db.backends.postgresql", "NAME": "foxray_django",
33 "USER": _u.username or "", "PASSWORD": _u.password or "", "HOST": _u.hostname or "",
34 "PORT": str(_u.port or "")}}
35else:
36 # A file, not memory: the live-server and threaded tests share it across connections.
37 DATABASES = {"default": {"ENGINE": "django.db.backends.sqlite3", "NAME": ":memory:",
38 "OPTIONS": {"timeout": 30},
39 "TEST": {"NAME": os.path.join(tempfile.gettempdir(), f"foxray-django-{os.getpid()}.sqlite3")}}}
40STATIC_URL = "/static/"
41DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField"
42EMAIL_BACKEND = "django.core.mail.backends.locmem.EmailBackend"
43ADMINS = [("Ops", "ops@example.com")]
44SERVER_EMAIL = "foxray@example.com"
45FOXRAY = {"AUTO_INIT": False, "SYNC_AFTER": True, "BASE_URL": "http://testserver"}