12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- # -*- coding: utf-8 -*-
- # TODO - G.M - 29-03-2018 - [Cleanup] Drop this file
- from pyramid.response import Response
- from pyramid.view import view_config
-
- from sqlalchemy.exc import DBAPIError
- from ..models import Content
-
-
- @view_config(route_name='home', renderer='../templates/mytemplate.jinja2')
- def test_config(request):
- try:
- project = request.config().WEBSITE_TITLE
- except Exception as e:
- return Response(e, content_type='text/plain', status=500)
- return {'project': project}
-
- # @view_config(route_name='home', renderer='../templates/mytemplate.jinja2')
- # def my_view(request):
- # try:
- # query = request.dbsession.query(MyModel)
- # one = query.filter(MyModel.name == 'one').first()
- # except DBAPIError:
- # return Response(db_err_msg, content_type='text/plain', status=500)
- # return {'one': one, 'project': 'tracim'}
-
-
- db_err_msg = """\
- Pyramid is having a problem using your SQL database. The problem
- might be caused by one of the following things:
-
- 1. You may need to run the "initialize_tracim_db" script
- to initialize your database tables. Check your virtual
- environment's "bin" directory for this script and try to run it.
-
- 2. Your database server may not be running. Check that the
- database server referred to by the "sqlalchemy.url" setting in
- your "development.ini" file is running.
-
- After you fix the problem, please restart the Pyramid application to
- try it again.
- """
|