Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move to jinja2 #2798

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CONTRIBUTORS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -284,3 +284,5 @@ Contributors
- Jon Davidson, 2016/07/18

- Keith Yang, 2016/07/22

- Hannah Krager, 2016/10/22
2 changes: 1 addition & 1 deletion pyramid/scaffolds/starter/+package+/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ def main(global_config, **settings):
""" This function returns a Pyramid WSGI application.
"""
config = Configurator(settings=settings)
config.include('pyramid_chameleon')
config.include('pyramid_jinja2')
config.add_static_view('static', 'static', cache_max_age=3600)
config.add_route('home', '/')
config.scan()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!DOCTYPE html>
<html lang="${request.locale_name}">
<html lang="\{\{request.locale_name\}\}">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
Expand All @@ -14,7 +14,7 @@
<link href="//oss.maxcdn.com/libs/twitter-bootstrap/3.0.3/css/bootstrap.min.css" rel="stylesheet">

<!-- Custom styles for this scaffold -->
<link href="${request.static_url('{{package}}:static/theme.css')}" rel="stylesheet">
<link href="\{\{request.static_url('{{package}}:static/theme.css')\}\}" rel="stylesheet">

<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
Expand All @@ -29,13 +29,12 @@
<div class="container">
<div class="row">
<div class="col-md-2">
<img class="logo img-responsive" src="${request.static_url('{{package}}:static/pyramid.png')}" alt="pyramid web framework">
<img class="logo img-responsive" src="\{\{request.static_url('{{package}}:static/pyramid.png')\}\}" alt="pyramid web framework">
</div>
<div class="col-md-10">
<div class="content">
<h1><span class="font-semi-bold">Pyramid</span> <span class="smaller">Starter scaffold</span></h1>
<p class="lead">Welcome to <span class="font-normal">${project}</span>, an&nbsp;application generated&nbsp;by<br>the <span class="font-normal">Pyramid Web Framework {{pyramid_version}}</span>.</p>
</div>
{% block content %}
<p>No content</p>
{% endblock content %}
</div>
</div>
<div class="row">
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{% extends "layout.jinja2" %}

{% block content%}
<div class="content">
<h1><span class="font-semi-bold">Pyramid</span> <span class="smaller">Starter scaffold</span></h1>
<p class="lead">Welcome to <span class="font-normal">\{\{project\}\}</span>, an&nbsp;application generated&nbsp;by<br>the <span class="font-normal">Pyramid Web Framework {{pyramid_version}}</span>.</p>
</div>
{% endblock content %}
2 changes: 1 addition & 1 deletion pyramid/scaffolds/starter/+package+/views.py_tmpl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from pyramid.view import view_config


@view_config(route_name='home', renderer='templates/mytemplate.pt')
@view_config(route_name='home', renderer='templates/mytemplate.jinja2')
def my_view(request):
return {'project': '{{project}}'}
2 changes: 1 addition & 1 deletion pyramid/scaffolds/starter/MANIFEST.in_tmpl
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
include *.txt *.ini *.cfg *.rst
recursive-include {{package}} *.ico *.png *.css *.gif *.jpg *.pt *.txt *.mak *.mako *.js *.html *.xml
recursive-include {{package}} *.ico *.png *.css *.gif *.jpg *.pt *.txt *.mak *.mako *.js *.html *.xml *.jinja2
2 changes: 1 addition & 1 deletion pyramid/scaffolds/starter/setup.py_tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ with open(os.path.join(here, 'CHANGES.txt')) as f:

requires = [
'pyramid',
'pyramid_chameleon',
'pyramid_jinja2',
'pyramid_debugtoolbar',
'waitress',
]
Expand Down
2 changes: 1 addition & 1 deletion pyramid/scaffolds/zodb/+package+/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def main(global_config, **settings):
""" This function returns a Pyramid WSGI application.
"""
config = Configurator(root_factory=root_factory, settings=settings)
config.include('pyramid_chameleon')
config.include('pyramid_jinja2')
config.add_static_view('static', 'static', cache_max_age=3600)
config.scan()
return config.make_wsgi_app()
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<link href="//oss.maxcdn.com/libs/twitter-bootstrap/3.0.3/css/bootstrap.min.css" rel="stylesheet">

<!-- Custom styles for this scaffold -->
<link href="${request.static_url('{{package}}:static/theme.css')}" rel="stylesheet">
<link href="\{\{request.static_url('{{package}}:static/theme.css')\}\}" rel="stylesheet">

<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
Expand All @@ -29,13 +29,12 @@
<div class="container">
<div class="row">
<div class="col-md-2">
<img class="logo img-responsive" src="${request.static_url('{{package}}:static/pyramid.png')}" alt="pyramid web framework">
<img class="logo img-responsive" src="\{\{request.static_url('{{package}}:static/pyramid.png')\}\}" alt="pyramid web framework">
</div>
<div class="col-md-10">
<div class="content">
<h1><span class="font-semi-bold">Pyramid</span> <span class="smaller">ZODB scaffold</span></h1>
<p class="lead">Welcome to <span class="font-normal">${project}</span>, an&nbsp;application generated&nbsp;by<br>the <span class="font-normal">Pyramid Web Framework {{pyramid_version}}</span>.</p>
</div>
{% block content %}
<p>No content</p>
{% endblock content %}
</div>
</div>
<div class="row">
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{% extends "layout.jinja2" %}
{% block content %}
<div class="content">
<h1><span class="font-semi-bold">Pyramid</span> <span class="smaller">ZODB scaffold</span></h1>
<p class="lead">Welcome to <span class="font-normal">\{\{project\}\}</span>, an&nbsp;application generated&nbsp;by<br>the <span class="font-normal">Pyramid Web Framework {{pyramid_version}}</span>.</p>
</div>
{% endblock content %}
2 changes: 1 addition & 1 deletion pyramid/scaffolds/zodb/+package+/views.py_tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ from pyramid.view import view_config
from .models import MyModel


@view_config(context=MyModel, renderer='templates/mytemplate.pt')
@view_config(context=MyModel, renderer='templates/mytemplate.jinja2')
def my_view(request):
return {'project': '{{project}}'}
2 changes: 1 addition & 1 deletion pyramid/scaffolds/zodb/MANIFEST.in_tmpl
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
include *.txt *.ini *.cfg *.rst
recursive-include {{package}} *.ico *.png *.css *.gif *.jpg *.pt *.txt *.mak *.mako *.js *.html *.xml
recursive-include {{package}} *.ico *.png *.css *.gif *.jpg *.pt *.txt *.mak *.mako *.js *.html *.xml *.jinja2
2 changes: 1 addition & 1 deletion pyramid/scaffolds/zodb/setup.py_tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ with open(os.path.join(here, 'CHANGES.txt')) as f:

requires = [
'pyramid',
'pyramid_chameleon',
'pyramid_jinja2',
'pyramid_debugtoolbar',
'pyramid_tm',
'pyramid_zodbconn',
Expand Down