parent
4bca6a432f
commit
286971649a
3 changed files with 18 additions and 0 deletions
|
|
@ -2,6 +2,8 @@ import os
|
||||||
|
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
|
from .version import get_current_version
|
||||||
|
|
||||||
|
|
||||||
BASE_DIR = Path(__file__).resolve().parent.parent.parent.parent
|
BASE_DIR = Path(__file__).resolve().parent.parent.parent.parent
|
||||||
DJANGO_PROJECT_DIR = os.path.join(BASE_DIR, "src", "newsreader")
|
DJANGO_PROJECT_DIR = os.path.join(BASE_DIR, "src", "newsreader")
|
||||||
|
|
@ -212,6 +214,8 @@ STATICFILES_FINDERS = [
|
||||||
DEFAULT_FROM_EMAIL = "newsreader@rss.fudiggity.nl"
|
DEFAULT_FROM_EMAIL = "newsreader@rss.fudiggity.nl"
|
||||||
|
|
||||||
# Project settings
|
# Project settings
|
||||||
|
VERSION = get_current_version()
|
||||||
|
|
||||||
# Reddit integration
|
# Reddit integration
|
||||||
REDDIT_CLIENT_ID = "CLIENT_ID"
|
REDDIT_CLIENT_ID = "CLIENT_ID"
|
||||||
REDDIT_CLIENT_SECRET = "CLIENT_SECRET"
|
REDDIT_CLIENT_SECRET = "CLIENT_SECRET"
|
||||||
|
|
|
||||||
|
|
@ -65,6 +65,7 @@ try:
|
||||||
dsn=os.environ.get("SENTRY_DSN"),
|
dsn=os.environ.get("SENTRY_DSN"),
|
||||||
integrations=[DjangoIntegration(), CeleryIntegration()],
|
integrations=[DjangoIntegration(), CeleryIntegration()],
|
||||||
send_default_pii=False,
|
send_default_pii=False,
|
||||||
|
release=VERSION,
|
||||||
)
|
)
|
||||||
except ImportError:
|
except ImportError:
|
||||||
pass
|
pass
|
||||||
|
|
|
||||||
13
src/newsreader/conf/version.py
Normal file
13
src/newsreader/conf/version.py
Normal file
|
|
@ -0,0 +1,13 @@
|
||||||
|
import os
|
||||||
|
import subprocess
|
||||||
|
|
||||||
|
|
||||||
|
def get_current_version():
|
||||||
|
if "VERSION" in os.environ:
|
||||||
|
return os.environ["VERSION"]
|
||||||
|
|
||||||
|
try:
|
||||||
|
output = subprocess.check_output(["git", "describe"], universal_newlines=True)
|
||||||
|
return output.strip()
|
||||||
|
except (subprocess.CalledProcessError, OSError):
|
||||||
|
return ""
|
||||||
Loading…
Add table
Add a link
Reference in a new issue