upload app
This commit is contained in:
11
cleanup_html/__init__.py
Normal file
11
cleanup_html/__init__.py
Normal file
@@ -0,0 +1,11 @@
|
||||
from pyramid.config import Configurator
|
||||
|
||||
|
||||
def main(global_config, **settings):
|
||||
""" This function returns a Pyramid WSGI application.
|
||||
"""
|
||||
with Configurator(settings=settings) as config:
|
||||
config.include('pyramid_jinja2')
|
||||
config.include('.routes')
|
||||
config.scan()
|
||||
return config.make_wsgi_app()
|
||||
3
cleanup_html/routes.py
Normal file
3
cleanup_html/routes.py
Normal file
@@ -0,0 +1,3 @@
|
||||
def includeme(config):
|
||||
config.add_static_view('static', 'static', cache_max_age=3600)
|
||||
config.add_route('home', '/')
|
||||
BIN
cleanup_html/static/pyramid-16x16.png
Normal file
BIN
cleanup_html/static/pyramid-16x16.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.3 KiB |
BIN
cleanup_html/static/pyramid.png
Normal file
BIN
cleanup_html/static/pyramid.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 13 KiB |
32
cleanup_html/static/theme.css
Normal file
32
cleanup_html/static/theme.css
Normal file
@@ -0,0 +1,32 @@
|
||||
@import url(//fonts.googleapis.com/css?family=Open+Sans:300,400,600,700);
|
||||
body {
|
||||
font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
|
||||
font-weight: 300;
|
||||
color: #1c1b1b;
|
||||
background: #ffffff;
|
||||
}
|
||||
h1,
|
||||
h2,
|
||||
h3,
|
||||
h4,
|
||||
h5,
|
||||
h6 {
|
||||
font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
|
||||
font-weight: 300;
|
||||
}
|
||||
p {
|
||||
font-weight: 300;
|
||||
}
|
||||
button, input, optgroup, select, textarea {
|
||||
color: black;
|
||||
}
|
||||
.font-normal {
|
||||
font-weight: 400;
|
||||
}
|
||||
.font-semi-bold {
|
||||
font-weight: 600;
|
||||
}
|
||||
.font-bold {
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
8
cleanup_html/templates/404.jinja2
Normal file
8
cleanup_html/templates/404.jinja2
Normal file
@@ -0,0 +1,8 @@
|
||||
{% extends "layout.jinja2" %}
|
||||
|
||||
{% block content %}
|
||||
<div class="content">
|
||||
<h1><span class="font-semi-bold">Pyramid</span> <span class="smaller">Starter project</span></h1>
|
||||
<p class="lead"><span class="font-semi-bold">404</span> Page Not Found</p>
|
||||
</div>
|
||||
{% endblock content %}
|
||||
49
cleanup_html/templates/layout.jinja2
Normal file
49
cleanup_html/templates/layout.jinja2
Normal file
@@ -0,0 +1,49 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="{{request.locale_name}}">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta name="description" content="pyramid web application">
|
||||
<meta name="author" content="Pylons Project">
|
||||
<link rel="shortcut icon" href="{{request.static_url('cleanup_html:static/pyramid-16x16.png')}}">
|
||||
|
||||
<title>Cookiecutter Starter project for the Pyramid Web Framework</title>
|
||||
|
||||
<!-- Bootstrap core CSS -->
|
||||
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
|
||||
|
||||
<!-- Custom styles for this scaffold -->
|
||||
<link href="{{request.static_url('cleanup_html:static/theme.css')}}" rel="stylesheet">
|
||||
|
||||
<!-- HTML5 shiv and Respond.js IE8 support of HTML5 elements and media queries -->
|
||||
<!--[if lt IE 9]>
|
||||
<script src="//oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js" integrity="sha384-0s5Pv64cNZJieYFkXYOTId2HMA2Lfb6q2nAcx2n0RTLUnCAoTTsS0nKEO27XyKcY" crossorigin="anonymous"></script>
|
||||
<script src="//oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js" integrity="sha384-ZoaMbDF+4LeFxg6WdScQ9nnR1QC2MIRxA1O9KWEXQwns1G8UNyIEZIQidzb0T1fo" crossorigin="anonymous"></script>
|
||||
<![endif]-->
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
{% block content %}
|
||||
<p>No content</p>
|
||||
{% endblock content %}
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="copyright">
|
||||
Copyright © Pylons Project
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<!-- Bootstrap core JavaScript
|
||||
================================================== -->
|
||||
<!-- Placed at the end of the document so the pages load faster -->
|
||||
<script src="//code.jquery.com/jquery-1.12.4.min.js" integrity="sha256-ZosEbRLbNQzLpnKIkEdrPv7lOy9C27hHQ+Xp8a4MxAQ=" crossorigin="anonymous"></script>
|
||||
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
|
||||
</body>
|
||||
</html>
|
||||
8
cleanup_html/templates/mytemplate.jinja2
Normal file
8
cleanup_html/templates/mytemplate.jinja2
Normal file
@@ -0,0 +1,8 @@
|
||||
{% extends "layout.jinja2" %}
|
||||
|
||||
{% block content %}
|
||||
<div class="content">
|
||||
<h1><span class="font-semi-bold">Pyramid</span> <span class="smaller">Starter project</span></h1>
|
||||
<p class="lead">Welcome to <span class="font-normal">{{project}}</span>, a Pyramid application generated by<br><span class="font-normal">Cookiecutter</span>.</p>
|
||||
</div>
|
||||
{% endblock content %}
|
||||
0
cleanup_html/views/__init__.py
Normal file
0
cleanup_html/views/__init__.py
Normal file
6
cleanup_html/views/default.py
Normal file
6
cleanup_html/views/default.py
Normal file
@@ -0,0 +1,6 @@
|
||||
from pyramid.view import view_config
|
||||
|
||||
|
||||
@view_config(route_name='home', renderer='cleanup_html:templates/mytemplate.jinja2')
|
||||
def my_view(request):
|
||||
return {'project': 'cleanup_html'}
|
||||
7
cleanup_html/views/notfound.py
Normal file
7
cleanup_html/views/notfound.py
Normal file
@@ -0,0 +1,7 @@
|
||||
from pyramid.view import notfound_view_config
|
||||
|
||||
|
||||
@notfound_view_config(renderer='cleanup_html:templates/404.jinja2')
|
||||
def notfound_view(request):
|
||||
request.response.status = 404
|
||||
return {}
|
||||
Reference in New Issue
Block a user