-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from pinax/dropping-support
Dropping support and standardizing docs
- Loading branch information
Showing
17 changed files
with
414 additions
and
248 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
version: 2.0 | ||
|
||
common: &common | ||
working_directory: ~/repo | ||
steps: | ||
- checkout | ||
- restore_cache: | ||
keys: | ||
- v2-deps-{{ .Environment.CIRCLE_JOB }}-{{ checksum "setup.py" }}-{{ checksum "tox.ini" }} | ||
- v2-deps- | ||
- run: | ||
name: install dependencies | ||
command: pip install --user tox | ||
- run: | ||
name: run tox | ||
command: ~/.local/bin/tox | ||
- run: | ||
name: upload coverage report | ||
command: | | ||
if [[ "$UPLOAD_COVERAGE" != 0 ]]; then | ||
PATH=$HOME/.local/bin:$PATH | ||
pip install --user codecov | ||
coverage xml | ||
~/.local/bin/codecov --required -X search gcov pycov -f coverage.xml --flags $CIRCLE_JOB | ||
fi | ||
- save_cache: | ||
paths: | ||
- .tox | ||
- ~/.cache/pip | ||
- ~/.local | ||
- ./eggs | ||
key: v2-deps-{{ .Environment.CIRCLE_JOB }}-{{ checksum "setup.py" }}-{{ checksum "tox.ini" }} | ||
|
||
jobs: | ||
lint: | ||
<<: *common | ||
docker: | ||
- image: circleci/python:3.6.1 | ||
environment: | ||
- TOXENV=checkqa | ||
- UPLOAD_COVERAGE=0 | ||
py27dj111: | ||
<<: *common | ||
docker: | ||
- image: circleci/python:2.7 | ||
environment: | ||
TOXENV=py27-dj111 | ||
py34dj111: | ||
<<: *common | ||
docker: | ||
- image: circleci/python:3.4 | ||
environment: | ||
TOXENV=py34-dj111 | ||
py34dj20: | ||
<<: *common | ||
docker: | ||
- image: circleci/python:3.4 | ||
environment: | ||
TOXENV=py34-dj20 | ||
py35dj111: | ||
<<: *common | ||
docker: | ||
- image: circleci/python:3.5 | ||
environment: | ||
TOXENV=py35-dj111 | ||
py35dj20: | ||
<<: *common | ||
docker: | ||
- image: circleci/python:3.5 | ||
environment: | ||
TOXENV=py35-dj20 | ||
py36dj111: | ||
<<: *common | ||
docker: | ||
- image: circleci/python:3.6 | ||
environment: | ||
TOXENV=py36-dj111 | ||
py36dj20: | ||
<<: *common | ||
docker: | ||
- image: circleci/python:3.6 | ||
environment: | ||
TOXENV=py36-dj20 | ||
|
||
workflows: | ||
version: 2 | ||
test: | ||
jobs: | ||
- lint | ||
- py27dj111 | ||
- py34dj111 | ||
- py34dj20 | ||
- py35dj111 | ||
- py35dj20 | ||
- py36dj111 | ||
- py36dj20 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,45 @@ | ||
build | ||
dist | ||
.coverage | ||
.tox | ||
.idea | ||
MANIFEST | ||
*.pyc | ||
*.egg-info | ||
*.egg | ||
.DS_Store | ||
|
||
# Byte-compiled / optimized / DLL files | ||
__pycache__/ | ||
*.py[cod] | ||
|
||
|
||
# Distribution / packaging | ||
.Python | ||
env/ | ||
build/ | ||
develop-eggs/ | ||
dist/ | ||
docs/_build/ | ||
eggs/ | ||
lib/ | ||
lib64/ | ||
parts/ | ||
sdist/ | ||
var/ | ||
*.egg-info/ | ||
.installed.cfg | ||
*.egg | ||
*.eggs | ||
.python-version | ||
|
||
# Pipfile | ||
Pipfile | ||
Pipfile.lock | ||
|
||
# Installer logs | ||
pip-log.txt | ||
pip-delete-this-directory.txt | ||
|
||
# Unit test / coverage reports | ||
htmlcov/ | ||
.eggs/ | ||
.tox/ | ||
.coverage | ||
.cache | ||
nosetests.xml | ||
coverage.xml | ||
|
||
# IDEs | ||
.idea/ |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Katherine “Kati” Michel |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
include AUTHORS | ||
include LICENSE | ||
include README.rst | ||
include README.md | ||
recursive-include pinax/news/static * | ||
recursive-include pinax/news/templates * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,183 @@ | ||
![](http://pinaxproject.com/pinax-design/patches/pinax-news.svg) | ||
|
||
# Pinax News | ||
|
||
[![CircleCi](https://img.shields.io/circleci/project/github/pinax/pinax-news.svg)](https://circleci.com/gh/pinax/pinax-news) | ||
[![Codecov](https://img.shields.io/codecov/c/github/pinax/pinax-news.svg)](https://codecov.io/gh/pinax/pinax-news) | ||
[![](https://img.shields.io/pypi/dm/pinax-news.svg)](https://pypi.python.org/pypi/pinax-news/) | ||
[![](https://img.shields.io/pypi/v/pinax-news.svg)](https://pypi.python.org/pypi/pinax-news/) | ||
|
||
[![](http://slack.pinaxproject.com/badge.svg)](http://slack.pinaxproject.com/) | ||
[![](https://img.shields.io/badge/license-MIT-blue.svg)](https://opensource.org/licenses/MIT) | ||
|
||
## Table of Contents | ||
|
||
* [About Pinax](#about-pinax) | ||
* [Overview](#overview) | ||
* [Features](#features) | ||
* [Supported Django and Python versions](#supported-django-and-python-versions) | ||
* [Documentation](#documentation) | ||
* [Installation](#installation) | ||
* [Settings](#settings) | ||
* [Usage](#usage) | ||
* [Change Log](#change-log) | ||
* [Contribute](#contribute) | ||
* [Code of Conduct](#code-of-conduct) | ||
* [Connect with Pinax](#connect-with-pinax) | ||
* [License](#license) | ||
|
||
## About Pinax | ||
|
||
Pinax is an open-source platform built on the Django Web Framework. It is an ecosystem of reusable | ||
Django apps, themes, and starter project templates. This collection can be found at http://pinaxproject.com. | ||
|
||
|
||
## pinax-news | ||
|
||
### Overview | ||
|
||
``pinax-news`` is a simple app for publishing links to news articles on your site. | ||
|
||
#### Supported Django and Python versions | ||
|
||
Django \ Python | 2.7 | 3.4 | 3.5 | 3.6 | ||
--------------- | --- | --- | --- | --- | ||
1.11 | * | * | * | * | ||
2.0 | | * | * | * | ||
|
||
|
||
## Documentation | ||
|
||
### Installation | ||
|
||
To install pinax-news: | ||
|
||
pip install pinax-news | ||
|
||
Add `pinax-news` to your `INSTALLED_APPS` setting: | ||
|
||
```python | ||
INSTALLED_APPS = ( | ||
... | ||
"imagekit", | ||
"pinax.news", | ||
... | ||
) | ||
``` | ||
|
||
You will need either `PIL` or `Pillow` installed for `imagekit` to work. We | ||
recommend `Pillow`: | ||
|
||
pip install Pillow | ||
|
||
### Settings | ||
|
||
There are two settings that have defaults but if you want to override them you | ||
need to just set them to the dotted-notation path to the `ImageSpec` class that | ||
you wish to use to process the `image` and `secondary_image` files for the | ||
`image_thumb` and `secondary_image_thumb` attributes on the `News` model. | ||
|
||
```python | ||
PINAX_NEWS_IMAGE_THUMBNAIL_SPEC = "pinax.news.specs.ImageThumbnail" | ||
PINAX_NEWS_SECONDARY_IMAGE_THUMBNAIL_SPEC = "pinax.news.specs.SecondaryImageThumbnail" | ||
``` | ||
|
||
To create your own `ImageSpec` classes you can reference the defaults, but it is | ||
basically subclassing `imagekit.ImageSpec`. | ||
|
||
### Usage | ||
|
||
In your template where you want to display news or press releases: | ||
|
||
First, load the template tags: | ||
|
||
{% load pinax_news_tags %} | ||
|
||
For news: | ||
|
||
{% news as news_items %} | ||
|
||
For press releases (new stories with the press_release boolean set to `True`): | ||
|
||
{% press_releases as press_release_items %} | ||
|
||
And here is an example that how you can show the news or press releases: | ||
|
||
```html | ||
{% for news_item in news_items %} | ||
<article class="news-article" style="{% if news_item.secondary_image_thumb %}background-image:url({% static news_item.secondary_image_thumb.url %});{% endif %}"> | ||
<h3> | ||
<a href="{{ news_item.url }}"> | ||
{% if news_item.image_thumb %}<img src="{{ news_item.image_thumb.url }}" width="168" />{% endif %} | ||
<span>{{ news_item.title }}</span> | ||
</a> | ||
</h3> | ||
</article> | ||
{% endfor %} | ||
``` | ||
|
||
Add and manage news and press releases via the Django admin. | ||
|
||
|
||
## Change Log | ||
|
||
### 2.0.0 | ||
|
||
* Add Django 2.0 compatibility testing | ||
* Drop Django 1.8, 1.9, 1.10 and Python 3.3 support | ||
* Move documentation into README | ||
* Standardize documentation layout | ||
* Convert CI and coverage to CircleCi and CodeCov | ||
* Add PyPi-compatible long description | ||
|
||
### 1.1.2 | ||
|
||
* fix packaging | ||
|
||
### 1.1.1 | ||
|
||
* fix packaging | ||
|
||
### 1.1.0 | ||
|
||
* added support for secondary images | ||
* added support for customized image sizing | ||
|
||
### 1.0.0 | ||
|
||
* added docs and tests and wired up CI | ||
|
||
### 0.1 | ||
|
||
* initial release | ||
|
||
|
||
## Contribute | ||
|
||
For an overview on how contributing to Pinax works read this [blog post](http://blog.pinaxproject.com/2016/02/26/recap-february-pinax-hangout/) | ||
and watch the included video, or read our [How to Contribute](http://pinaxproject.com/pinax/how_to_contribute/) section. | ||
For concrete contribution ideas, please see our | ||
[Ways to Contribute/What We Need Help With](http://pinaxproject.com/pinax/ways_to_contribute/) section. | ||
|
||
In case of any questions we recommend you join our [Pinax Slack team](http://slack.pinaxproject.com) | ||
and ping us there instead of creating an issue on GitHub. Creating issues on GitHub is of course | ||
also valid but we are usually able to help you faster if you ping us in Slack. | ||
|
||
We also highly recommend reading our blog post on [Open Source and Self-Care](http://blog.pinaxproject.com/2016/01/19/open-source-and-self-care/). | ||
|
||
## Code of Conduct | ||
|
||
In order to foster a kind, inclusive, and harassment-free community, the Pinax Project | ||
has a [code of conduct](http://pinaxproject.com/pinax/code_of_conduct/). | ||
We ask you to treat everyone as a smart human programmer that shares an interest in Python, Django, and Pinax with you. | ||
|
||
|
||
## Connect with Pinax | ||
|
||
For updates and news regarding the Pinax Project, please follow us on Twitter [@pinaxproject](https://twitter.com/pinaxproject) | ||
and check out our [Pinax Project blog](http://blog.pinaxproject.com). | ||
|
||
|
||
## License | ||
|
||
Copyright (c) 2012-2018 James Tauber and contributors under the [MIT license](https://opensource.org/licenses/MIT). |
Oops, something went wrong.