Skip to content

Commit

Permalink
Merge pull request #162 from sympy/sympy-version-in-footer
Browse files Browse the repository at this point in the history
Show SymPy version in the footer
  • Loading branch information
aktech committed Jun 15, 2020
2 parents e4d4523 + d96e43d commit 3975dd5
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.rst
Expand Up @@ -47,7 +47,7 @@ This will spin up a local server that runs on port ``8080``.
Open a web browser and go to http://localhost:8080.
You should see GUI of SymPy Gamma

Note: Make sure to set ``DEBUG = False`` in `settings.py` for serving staticfiles
Note: Make sure to set ``DEBUG = True`` in `settings.py` for serving staticfiles
locally.


Expand Down
3 changes: 2 additions & 1 deletion app/templates/base.html
Expand Up @@ -67,11 +67,12 @@
<div id="footer">
<p>
SymPy Gamma version {{ app_version }}.
SymPy version {{ sympy_version }}
</p>

<p>
&copy; 2013-{{ current_year }} SymPy Development Team. This project is
open-source: <a href="https://github.com/sympy/sympy_gamma/">
Open Source: <a href="https://github.com/sympy/sympy_gamma/">
SymPy Gamma on Github</a>.
</p>
</div>
Expand Down
9 changes: 6 additions & 3 deletions app/views.py
@@ -1,4 +1,6 @@
from __future__ import absolute_import

import sympy
from django.http import HttpResponse, Http404
from django.shortcuts import render_to_response, redirect
from django.template.loader import render_to_string
Expand Down Expand Up @@ -47,6 +49,7 @@ def _wrapper(request, **kwargs):
try:
template, params = result
params['app_version'] = version
params['sympy_version'] = sympy.__version__
params['current_year'] = datetime.datetime.now().year
return render_to_response(template, params)
except ValueError:
Expand Down Expand Up @@ -156,7 +159,7 @@ def eval_card(request, card_name):
result = g.eval_card(card_name, expression, variable, parameters)
except ValueError as e:
return HttpResponse(json.dumps({
'error': e.message
'error': str(e)
}), content_type="application/json")
except:
trace = traceback.format_exc(5)
Expand All @@ -174,7 +177,7 @@ def get_card_info(request, card_name):
result = g.get_card_info(card_name, expression, variable)
except ValueError as e:
return HttpResponse(json.dumps({
'error': e.message
'error': str(e)
}), content_type="application/json")
except DeadlineExceededError:
return HttpResponse(json.dumps({
Expand Down Expand Up @@ -210,7 +213,7 @@ def get_card_full(request, card_name):
'input': card_info['input'],
'card': card_name,
'variable': variable,
'error': e.message
'error': str(e)
},
'input': expression
}), content_type="text/html")
Expand Down

0 comments on commit 3975dd5

Please sign in to comment.