Skip to content

Commit

Permalink
removed unnecessary files
Browse files Browse the repository at this point in the history
version number added with custom context processor
this is now version 0.3.1
  • Loading branch information
Raul Sirel committed Nov 25, 2016
1 parent b76ab7f commit 1434f54
Show file tree
Hide file tree
Showing 11 changed files with 16 additions and 1 deletion.
1 change: 1 addition & 0 deletions VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.3.1
1 change: 1 addition & 0 deletions settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@
'django.template.context_processors.tz',
'django.template.context_processors.request',
'django.contrib.messages.context_processors.messages',
'texta.utils.context_processors.get_version'
],
'loaders': [
'django.template.loaders.filesystem.Loader',
Expand Down
2 changes: 1 addition & 1 deletion templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<link rel="stylesheet" href="{{STATIC_URL}}bootstrap/css/bootstrap-theme.min.css">
<link rel="stylesheet" type="text/css" href="{{STATIC_URL}}base/frame.css">

<title>TEXTA Toolkit</title>
<title>TEXTA Toolkit {{texta_version}}</title>
</head>

<body>
Expand Down
Empty file removed texta/base/migrations/__init__.py
Empty file.
Empty file.
Empty file.
Empty file removed texta/lm/migrations/__init__.py
Empty file.
Empty file.
Empty file.
Empty file.
13 changes: 13 additions & 0 deletions texta/utils/context_processors.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# -*- coding: utf8 -*-
import os
from pathlib import Path

def get_version(request):
try:
current_path = Path(os.path.dirname(os.path.realpath(__file__)))
version_file_path = os.path.join(str(current_path.parent.parent),"VERSION")
with open(version_file_path, "r")as fh:
version = fh.read()
except:
version = "UNKNOWN"
return {"texta_version": version}

0 comments on commit 1434f54

Please sign in to comment.