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

sync up files with pyramid-cookie-cutter-starter #1

Merged
merged 1 commit into from
Feb 9, 2017
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 @@ -108,3 +108,5 @@ Contributors
------------

- Domen Kožar, 2016-12-07

- Steve Piercy, 2016-12-24
15 changes: 13 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Requirements
Usage
-----

1. Generate a Pyramid project.
1. Generate a Pyramid project, following the prompts from the command.

.. code-block:: bash

Expand All @@ -32,11 +32,22 @@ Usage

.. code-block:: bash

# Change directory into your newly created project.
$ cd myproj
# Create a virtual environment...
$ python3 -m venv env
# ...where we upgrade packaging tools...
$ env/bin/pip install --upgrade pip setuptools
# ...and into which we install our project and its testing requirements.
$ env/bin/pip install -e ".[testing]"

3. Run your project.
3. Run your project's tests.

.. code-block:: bash

$ env/bin/pytest

4. Run your project.

.. code-block:: bash

Expand Down
15 changes: 12 additions & 3 deletions hooks/post_gen_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
venv=venv,
venv_cmd=venv_cmd,
pip_cmd=os.path.join(venv_bin, 'pip'),
pytest_cmd=os.path.join(venv_bin, 'pytest'),
pserve_cmd=os.path.join(venv_bin, 'pserve'),
)
msg = dedent(
Expand All @@ -31,14 +32,22 @@
Welcome to Pyramid. Sorry for the convenience.
%(separator)s

Create a virtual environment for the project:
Change directory into your newly created project.
cd {{ cookiecutter.repo_name }}

Create a Python virtual environment.
%(venv_cmd)s %(venv)s

Install the project into the virtual environment:
Upgrade packaging tools.
%(pip_cmd)s install --upgrade pip setuptools

Install the project in editable mode with its testing requirements.
%(pip_cmd)s install -e ".[testing]"

To run the generated application:
Run your project's tests.
%(pytest_cmd)s

Run your project.
%(pserve_cmd)s development.ini
""" % vars)
print(msg)
24 changes: 18 additions & 6 deletions {{cookiecutter.repo_name}}/README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,26 @@
Getting Started
---------------

- Create a Python virtual environment:
- Change directory into your newly created project.

python3 -m venv $VENV
cd {{ cookiecutter.project_name }}

- Install the project in editable mode:
- Create a Python virtual environment.

$VENV/bin/pip install -e ".[testing]"
python3 -m venv env

- Start the server:
- Upgrade packaging tools.

$VENV/bin/pserve development.ini
env/bin/pip install --upgrade pip setuptools wheel

- Install the project in editable mode with its testing requirements.

env/bin/pip install -e ".[testing]"

- Run your project's tests.

env/bin/pytest

- Run your project.

env/bin/pserve development.ini
5 changes: 3 additions & 2 deletions {{cookiecutter.repo_name}}/development.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
###
# app configuration
# http://docs.pylonsproject.org/projects/pyramid/en/latest/narr/environment.html
###

[app:main]
Expand All @@ -23,11 +24,11 @@ pyramid.includes =

[server:main]
use = egg:waitress#main
host = 127.0.0.1
port = 6543
listen = 127.0.0.1:6543 [::1]:6543

###
# logging configuration
# http://docs.pylonsproject.org/projects/pyramid/en/latest/narr/logging.html
###

[loggers]
Expand Down
5 changes: 3 additions & 2 deletions {{cookiecutter.repo_name}}/production.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
###
# app configuration
# http://docs.pylonsproject.org/projects/pyramid/en/latest/narr/environment.html
###

[app:main]
Expand All @@ -17,11 +18,11 @@ pyramid.default_locale_name = en

[server:main]
use = egg:waitress#main
host = 127.0.0.1
port = 6543
listen = *:6543

###
# logging configuration
# http://docs.pylonsproject.org/projects/pyramid/en/latest/narr/logging.html
###

[loggers]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,12 @@ p {
color: #f2b7bd;
font-weight: 400;
}
.starter-template .links ul li a {
color: #ffffff;
.starter-template .links ul li a, a {
color: #f2b7bd;
text-decoration: underline;
}
.starter-template .links ul li a:hover {
.starter-template .links ul li a:hover, a:hover {
color: #ffffff;
text-decoration: underline;
}
.starter-template .links ul li .icon-muted {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
<!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">
<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("' + cookiecutter.repo_name + ':static/pyramid-16x16.png") }}' }}">
<link rel="shortcut icon" href="{{ '{{request.static_url(' }}'{{cookiecutter.repo_name}}:static/pyramid-16x16.png'){{ '}}' }}">

<title>Cookie Cutter Scaffold for The Pyramid Web Framework</title>
<title>Cookiecutter Jinja2 project for the Pyramid Web Framework</title>

<!-- Bootstrap core CSS -->
<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("' + cookiecutter.repo_name + ':static/theme.css") }}' }}" rel="stylesheet">
<link href="{{ '{{request.static_url(' }}'{{cookiecutter.repo_name}}: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,20 +29,20 @@
<div class="container">
<div class="row">
<div class="col-md-2">
<img class="logo img-responsive" src="{{ '{{ request.static_url("' + cookiecutter.repo_name + ':static/pyramid.png") }}' }}" alt="pyramid web framework">
<img class="logo img-responsive" src="{{ '{{request.static_url(' }}'{{cookiecutter.repo_name}}: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">Scaffold</span></h1>
<p class="lead">{% raw %}{% trans %}Welcome to{% endtrans %}{% endraw %} <span class="font-normal">{{ '{{ project }}' }}</span>, a&nbsp;Pyramid application generated&nbsp;by<br><span class="font-normal">Cookie Cutter</span>.</p>
<p class="lead">{% raw %}{% trans %}Welcome to{% endtrans %}{% endraw %} <span class="font-normal">{{ '{{ project }}' }}</span>, a&nbsp;Pyramid application generated&nbsp;by<br><span class="font-normal">Cookiecutter</span>.</p>
</div>
</div>
</div>
<div class="row">
<div class="links">
<ul>
<li><i class="glyphicon glyphicon-cog icon-muted"></i><a href="https://github.com/Pylons/pyramid">Github Project</a></li>
<li><i class="glyphicon glyphicon-globe icon-muted"></i><a href="irc://irc.freenode.net#pyramid">IRC Channel</a></li>
<li><i class="glyphicon glyphicon-globe icon-muted"></i><a href="https://webchat.freenode.net/?channels=pyramid">IRC Channel</a></li>
<li><i class="glyphicon glyphicon-home icon-muted"></i><a href="http://pylonsproject.org">Pylons Project</a></li>
</ul>
</div>
Expand Down