[GH-ISSUE #10] layout not found #6

Closed
opened 2026-02-26 01:32:52 +03:00 by kerem · 6 comments
Owner

Originally created by @fccoelho on GitHub (Aug 26, 2015).
Original GitHub issue: https://github.com/jeffknupp/sandman2/issues/10

I am getting this error on sandman2ctl with postgresql

jinja2.exceptions.TemplateNotFound: layout.html

Originally created by @fccoelho on GitHub (Aug 26, 2015). Original GitHub issue: https://github.com/jeffknupp/sandman2/issues/10 I am getting this error on sandman2ctl with postgresql jinja2.exceptions.TemplateNotFound: layout.html
kerem closed this issue 2026-02-26 01:32:52 +03:00
Author
Owner

@DanielJoyce commented on GitHub (Sep 4, 2015):

Same issue here. Installed via pip

pip install sandman2 doesn't seem to include templates, only the code/modules

<!-- gh-comment-id:137812901 --> @DanielJoyce commented on GitHub (Sep 4, 2015): Same issue here. Installed via pip pip install sandman2 doesn't seem to include templates, only the code/modules
Author
Owner

@DanielJoyce commented on GitHub (Sep 4, 2015):

Checked out and ran github version via run.py, admin console works, but layout.css is missing as well, its not in the repo.

<!-- gh-comment-id:137813949 --> @DanielJoyce commented on GitHub (Sep 4, 2015): Checked out and ran github version via run.py, admin console works, but layout.css is missing as well, its not in the repo.
Author
Owner

@jeffknupp commented on GitHub (Sep 16, 2015):

The file is not required, removing it from the template now.

<!-- gh-comment-id:140908303 --> @jeffknupp commented on GitHub (Sep 16, 2015): The file is not required, removing it from the template now.
Author
Owner

@m3talstorm commented on GitHub (Nov 26, 2015):

sudo pip install git+https://github.com/jeffknupp/sandman2.git

Worked for me

<!-- gh-comment-id:159777297 --> @m3talstorm commented on GitHub (Nov 26, 2015): sudo pip install git+https://github.com/jeffknupp/sandman2.git Worked for me
Author
Owner

@dbaty commented on GitHub (Oct 11, 2016):

I can reproduce the TemplateNotFound with the latest version of sandman (1.0.4):

[2016-10-11 14:30:47,654] ERROR in app: Exception on /admin/ [GET]
Traceback (most recent call last):
  File "/path/to/env/lib/python3.5/site-packages/flask/app.py", line 1988, in wsgi_app
    response = self.full_dispatch_request()
  File "/path/to/env/lib/python3.5/site-packages/flask/app.py", line 1641, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/path/to/env/lib/python3.5/site-packages/flask/app.py", line 1544, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/path/to/env/lib/python3.5/site-packages/flask/_compat.py", line 33, in reraise
    raise value
  File "/path/to/env/lib/python3.5/site-packages/flask/app.py", line 1639, in full_dispatch_request
    rv = self.dispatch_request()
  File "/path/to/env/lib/python3.5/site-packages/flask/app.py", line 1625, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/path/to/env/lib/python3.5/site-packages/flask_admin/base.py", line 69, in inner
    return self._run_view(f, *args, **kwargs)
  File "/path/to/env/lib/python3.5/site-packages/flask_admin/base.py", line 368, in _run_view
    return fn(self, *args, **kwargs)
  File "/path/to/env/lib/python3.5/site-packages/flask_admin/base.py", line 452, in index
    return self.render(self._template)
  File "/path/to/env/lib/python3.5/site-packages/flask_admin/base.py", line 308, in render
    return render_template(template, **kwargs)
  File "/path/to/env/lib/python3.5/site-packages/flask/templating.py", line 134, in render_template
    context, ctx.app)
  File "/path/to/env/lib/python3.5/site-packages/flask/templating.py", line 116, in _render
    rv = template.render(context)
  File "/path/to/env/lib/python3.5/site-packages/jinja2/environment.py", line 989, in render
    return self.environment.handle_exception(exc_info, True)
  File "/path/to/env/lib/python3.5/site-packages/jinja2/environment.py", line 754, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/path/to/env/lib/python3.5/site-packages/jinja2/_compat.py", line 37, in reraise
    raise value.with_traceback(tb)
  File "/path/to/env/lib/python3.5/site-packages/flask_admin/templates/bootstrap3/admin/index.html", line 1, in top-level template code
    {% extends 'admin/master.html' %}
  File "/path/to/env/lib/python3.5/site-packages/flask_admin/templates/bootstrap3/admin/master.html", line 1, in top-level template code
    {% extends admin_base_template %}
  File "/path/to/env/lib/python3.5/site-packages/flask/templating.py", line 57, in get_source
    return self._get_source_fast(environment, template)
  File "/path/to/env/lib/python3.5/site-packages/flask/templating.py", line 85, in _get_source_fast
    raise TemplateNotFound(template)
jinja2.exceptions.TemplateNotFound: layout.html

Indeed there are no templates/ directory installed by pip install sandman2:

$ ls -l /path/to/env/lib/python3.5/site-packages/sandman2/
total 52
-rw-r--r-- 1 damien damien  459 12 sept. 20:29 admin.py
-rw-r--r-- 1 damien damien 6718 12 sept. 20:29 app.py
-rw-r--r-- 1 damien damien 2745 12 sept. 20:29 decorators.py
-rw-r--r-- 1 damien damien 2689 12 sept. 20:29 exception.py
-rw-r--r-- 1 damien damien   83 12 sept. 20:29 __init__.py
-rw-r--r-- 1 damien damien 4512 12 sept. 20:29 model.py
drwxr-xr-x 2 damien damien 4096 11 oct.  14:25 __pycache__
drwxr-xr-x 3 damien damien 4096 11 oct.  14:25 scripts
-rw-r--r-- 1 damien damien 9727 20 sept. 21:33 service.py

But files in templates/layout.html are necessary for the admin.

Could it be a packaging issue?

<!-- gh-comment-id:252909562 --> @dbaty commented on GitHub (Oct 11, 2016): I can reproduce the TemplateNotFound with the latest version of `sandman` (1.0.4): ``` [2016-10-11 14:30:47,654] ERROR in app: Exception on /admin/ [GET] Traceback (most recent call last): File "/path/to/env/lib/python3.5/site-packages/flask/app.py", line 1988, in wsgi_app response = self.full_dispatch_request() File "/path/to/env/lib/python3.5/site-packages/flask/app.py", line 1641, in full_dispatch_request rv = self.handle_user_exception(e) File "/path/to/env/lib/python3.5/site-packages/flask/app.py", line 1544, in handle_user_exception reraise(exc_type, exc_value, tb) File "/path/to/env/lib/python3.5/site-packages/flask/_compat.py", line 33, in reraise raise value File "/path/to/env/lib/python3.5/site-packages/flask/app.py", line 1639, in full_dispatch_request rv = self.dispatch_request() File "/path/to/env/lib/python3.5/site-packages/flask/app.py", line 1625, in dispatch_request return self.view_functions[rule.endpoint](**req.view_args) File "/path/to/env/lib/python3.5/site-packages/flask_admin/base.py", line 69, in inner return self._run_view(f, *args, **kwargs) File "/path/to/env/lib/python3.5/site-packages/flask_admin/base.py", line 368, in _run_view return fn(self, *args, **kwargs) File "/path/to/env/lib/python3.5/site-packages/flask_admin/base.py", line 452, in index return self.render(self._template) File "/path/to/env/lib/python3.5/site-packages/flask_admin/base.py", line 308, in render return render_template(template, **kwargs) File "/path/to/env/lib/python3.5/site-packages/flask/templating.py", line 134, in render_template context, ctx.app) File "/path/to/env/lib/python3.5/site-packages/flask/templating.py", line 116, in _render rv = template.render(context) File "/path/to/env/lib/python3.5/site-packages/jinja2/environment.py", line 989, in render return self.environment.handle_exception(exc_info, True) File "/path/to/env/lib/python3.5/site-packages/jinja2/environment.py", line 754, in handle_exception reraise(exc_type, exc_value, tb) File "/path/to/env/lib/python3.5/site-packages/jinja2/_compat.py", line 37, in reraise raise value.with_traceback(tb) File "/path/to/env/lib/python3.5/site-packages/flask_admin/templates/bootstrap3/admin/index.html", line 1, in top-level template code {% extends 'admin/master.html' %} File "/path/to/env/lib/python3.5/site-packages/flask_admin/templates/bootstrap3/admin/master.html", line 1, in top-level template code {% extends admin_base_template %} File "/path/to/env/lib/python3.5/site-packages/flask/templating.py", line 57, in get_source return self._get_source_fast(environment, template) File "/path/to/env/lib/python3.5/site-packages/flask/templating.py", line 85, in _get_source_fast raise TemplateNotFound(template) jinja2.exceptions.TemplateNotFound: layout.html ``` Indeed there are no `templates/` directory installed by `pip install sandman2`: ``` $ ls -l /path/to/env/lib/python3.5/site-packages/sandman2/ total 52 -rw-r--r-- 1 damien damien 459 12 sept. 20:29 admin.py -rw-r--r-- 1 damien damien 6718 12 sept. 20:29 app.py -rw-r--r-- 1 damien damien 2745 12 sept. 20:29 decorators.py -rw-r--r-- 1 damien damien 2689 12 sept. 20:29 exception.py -rw-r--r-- 1 damien damien 83 12 sept. 20:29 __init__.py -rw-r--r-- 1 damien damien 4512 12 sept. 20:29 model.py drwxr-xr-x 2 damien damien 4096 11 oct. 14:25 __pycache__ drwxr-xr-x 3 damien damien 4096 11 oct. 14:25 scripts -rw-r--r-- 1 damien damien 9727 20 sept. 21:33 service.py ``` But files in `templates/layout.html` are necessary for the admin. Could it be a packaging issue?
Author
Owner

@skunkwerk commented on GitHub (Nov 1, 2016):

+1
same issue here with fresh 'pip install sandman2'
workaround is to use 'pip install git+https://github.com/jeffknupp/sandman2.git' instead

<!-- gh-comment-id:257693026 --> @skunkwerk commented on GitHub (Nov 1, 2016): +1 same issue here with fresh 'pip install sandman2' workaround is to use 'pip install git+https://github.com/jeffknupp/sandman2.git' instead
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/sandman2-jeffknupp#6
No description provided.