0

whenever i try to integrate templates in aiohttp im facing this issue i dont know where exactly the issue is from here is my code

from aiohttp import web
from routes import setup_routes
import aiohttp_jinja2
import jinja2

app = web.Application()
# app.add_routes([web.get('/', hello),
# web.get('verification/',email_verification)
# ])


setup_routes(app)
# aiohttp_jinja2.setup(app,loader=jinja2.FileSystemLoader(('C:\Users\madhumani\workspace\project-master\drfc\mxion\aiohttp\templates'))
aiohttp_jinja2.setup(app,loader=jinja2.FileSystemLoader('templates')

web.run_app(app,port=9090)

if i remove that aiohttp_jinja2.setup line everything works fine
i have followed everything mentioned in the docs for setting up templates but cant figure out the issue

john
  • 539
  • 2
  • 9
  • 24
  • 2
    Use a [raw string](https://stackoverflow.com/questions/2081640/what-exactly-do-u-and-r-string-flags-do-and-what-are-raw-string-literals) for the path containing backslash characters: `r'C:\Users\madhumani\workspace\project-master\drfc\mxion\aiohttp\templates'` – user4815162342 Dec 24 '18 at 17:18
  • 1
    You are missing a closing braces `)` on the jinja setup line – balki Dec 27 '18 at 18:40

0 Answers0