Skip to content

Commit 626ee7f

Browse files
committed
Merge branch 'release/0.2.1'
2 parents 8159206 + fe19afc commit 626ee7f

File tree

6 files changed

+24
-8
lines changed

6 files changed

+24
-8
lines changed

.bumpversion.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[bumpversion]
2-
current_version = 0.2.0
2+
current_version = 0.2.1
33
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(\-dev(?P<dev>\d+))?
44
serialize =
55
{major}.{minor}.{patch}-dev{dev}

CHANGELOG.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
Revision History
22
================
33

4+
0.2.1 2018-12-09
5+
6+
- Don't modify `home_namespace` globally
7+
- Exclude `.pyc` files from distribution
8+
9+
410
0.2.0 2018-12-08
511

612
- Allow `settings.PROJECT_HOME_NAMESPACE` to be an actual URL, rather than just an internal namespace

MANIFEST.in

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
include CHANGELOG.rst
22
include LICENSE
33
include README.rst
4+
45
recursive-include project_home_tags/templatetags *
6+
7+
global-exclude *.pyc

README.rst

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,13 @@ Specify the ``PROJECT_HOME_NAMESPACE`` in ``settings.py``:
4848
PROJECT_HOME_NAMESPACE = 'project_name:index_view'
4949
5050
51+
Rather than using an internal namespace, you can also set ``PROJECT_HOME_NAMESPACE`` to a specific URL:
52+
53+
.. code-block:: python
54+
55+
PROJECT_HOME_NAMESPACE = 'djangoproject.com'
56+
57+
5158
By default, a link created with a ``project_home_tags`` template tag has 'Home' as its text. This can be overridden by defining an optional project-wide label with ``PROJECT_HOME_LABEL`` in ``settings.py``:
5259

5360
.. code-block:: python
@@ -144,4 +151,4 @@ If ``settings.PROJECT_HOME_NAMESPACE`` is defined as ``'project_name:index_view'
144151
</ol>
145152
146153
147-
*Version 0.2.0*
154+
*Version 0.2.1*

project_home_tags/templatetags/project_home.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,16 @@ def home_url():
2222
2323
Returns None if PROJECT_HOME_NAMESPACE is not defined in settings.
2424
"""
25-
global home_namespace
2625
try:
2726
return reverse(home_namespace)
2827
except Exception:
28+
url = home_namespace
2929
try:
3030
validate_url = URLValidator()
31-
if '://' not in home_namespace:
32-
home_namespace = 'http://' + home_namespace
33-
validate_url(home_namespace)
34-
return(home_namespace)
31+
if '://' not in url:
32+
url = 'http://' + url
33+
validate_url(url)
34+
return(url)
3535
except ValidationError:
3636
return None
3737

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def read(*paths):
2424

2525
setup(
2626
name='django-project-home-templatetags',
27-
version='0.2.0',
27+
version='0.2.1',
2828
packages=['project_home_tags'],
2929
include_package_data=True,
3030
license='BSD License',

0 commit comments

Comments
 (0)