Skip to content

Commit

Permalink
Add django>=1.11 requirement
Browse files Browse the repository at this point in the history
Improve doc markup
  • Loading branch information
grahamu committed Jan 20, 2018
1 parent dc5004e commit 45d7392
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 13 deletions.
1 change: 0 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ common: &common
- 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
Expand Down
28 changes: 18 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,18 +62,27 @@ Django \ Python | 2.7 | 3.4 | 3.5 | 3.6

Install the development version:

pip install pinax-badges
```shell
$ pip install pinax-badges
```

Add `pinax.badges` to your `INSTALLED_APPS` setting:

INSTALLED_APPS = (
```python
INSTALLED_APPS = [
# other apps
"pinax.badges",
)
]
```

Add entry to your `urls.py`:
Add `pinax.badges.urls` to your project urlpatterns:

url(r"^badges/", include("pinax.badges.urls", namespace="pinax_badges"))
```python
urlpatterns = [
# other urls
url(r"^badges/", include("pinax.badges.urls", namespace="pinax_badges")),
]
```


### Usage
Expand Down Expand Up @@ -173,7 +182,7 @@ to `possibly_award_badge()`.

### Asynchronous Badges

!!! important
**Important**
To use asynchronous badges you must have [celery](http://github.com/ask/celery)
installed and configured.

Expand All @@ -191,7 +200,6 @@ compute `award()` correctly. This may be necessary because your `Badge`
requires some mutable state.

```python

class AddictBadge(Badge):
# stuff
async = True
Expand Down Expand Up @@ -244,13 +252,13 @@ This tag returns the number of badges that have been awarded to this user, it
can either set a value in context, or simple display the count. To display the
count its syntax is:

```html
```django
{% badge_count user %}
```

To get the count as a template variable:

```html
```django
{% badge_count user as badges %}
```

Expand All @@ -260,7 +268,7 @@ This tag provides a `QuerySet` of all of a user's badges, ordered by when
they were awarded, descending, and makes them available as a template variable.
The `QuerySet` is composed of `pinax.badges.models.BadgeAward` instances.

```html
```django
{% badges_for_user user as badges %}
```

Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
.. image:: http://slack.pinaxproject.com/badge.svg
:target: http://slack.pinaxproject.com/
.. image:: https://img.shields.io/badge/license-MIT-blue.svg
:target: https://pypi.python.org/pypi/pinax-badges/
:target: https://opensource.org/licenses/MIT/
\
Expand Down Expand Up @@ -80,7 +80,7 @@
"Topic :: Software Development :: Libraries :: Python Modules",
],
install_requires=[
"Django>=1.8"
"django>=1.11",
],
tests_require=[
],
Expand Down

0 comments on commit 45d7392

Please sign in to comment.