Hey, thanks for the response!
Im not very familiar with the Pyramid .ini files. I created my local project just by installing pyramid and creating the app itself. I took a look at the pyramid folder and found 2 ini files: development.ini_tmpl and production.ini_tmpl. Are these the right ones? Should I remove the tmpl - ending? So my ini file would be development.ini.
This is what was inside the file:
> [app:main] use = egg:{{project}}
>
> pyramid.reload_templates = true pyramid.debug_authorization = false
> pyramid.debug_notfound = false pyramid.debug_routematch = false
> pyramid.debug_templates = true pyramid.default_locale_name = en
> pyramid.includes = pyramid_debugtoolbar
>
> [server:main] use = egg:pyramid#wsgiref listen = *:6543
>
> # Begin logging configuration
>
> [loggers] keys = root, {{package_logger}}
>
> [handlers] keys = console
>
> [formatters] keys = generic
>
> [logger_root] level = INFO handlers = console
>
> [logger_{{package_logger}}] level = DEBUG handlers = qualname =
> {{package}}
>
> [handler_console] class = StreamHandler args = (sys.stderr,) level =
> NOTSET formatter = generic
>
> [formatter_generic] format = %(asctime)s %(levelname)-5.5s
> [%(name)s][%(threadName)s] %(message)s
>
> # End logging configuration
I now did what you suggested. However I am still getting an error when trying to run the web-app. It only says Error Code: Unhandled Exception, and there is nothing in the error logs.
This is my very simple Pyramid code:
> from waitress import serve from pyramid.config import Configurator
> from pyramid.response import Response
>
>
> def hello_world(request):
> print('Incoming request')
> return Response('<body><h1>Hello World!</h1></body>')
>
>
> if __name__ == '__main__':
> with Configurator() as config:
> config.add_route('hello', '/')
> config.add_view(hello_world, route_name='hello')
> app = config.make_wsgi_app()
> serve(app, host='0.0.0.0', port=6543)
And finally the WSGI:
import sys
# add your project directory to the sys.path
project_home = u'/home/vtoivonen/pyramidtest/hello.py'
if project_home not in sys.path:
sys.path.append(project_home)
from pyramid.paster import get_app, setup_logging
ini_path = '/home/vtoivonen/pyramidtest/config/development.ini'
setup_logging(ini_path)
application = get_app(ini_path, 'main')
I am kind of lost here, would really appreciate more help!