Skip to content

Commit 5086eeb

Browse files
authored
Merge pull request #5 from Tivix/master
Pull updates
2 parents 1a964f9 + e9215f4 commit 5086eeb

31 files changed

+853
-158
lines changed

.coveragerc

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# .coveragerc to control coverage.py
2+
[run]
3+
omit=*site-packages*,*distutils*,*migrations*
4+
5+
[report]
6+
# Regexes for lines to exclude from consideration
7+
exclude_lines =
8+
# Have to re-enable the standard pragma
9+
pragma: no cover
10+
11+
# Don't complain about missing debug-only code:
12+
def __repr__
13+
if self\.debug
14+
15+
# Don't complain if tests don't hit defensive assertion code:
16+
raise AssertionError
17+
raise NotImplementedError
18+
19+
# Don't complain if non-runnable code isn't run:
20+
if 0:
21+
if __name__ == .__main__.:
22+
23+
ignore_errors = True
24+
25+
[html]
26+
directory = coverage_html

.gitignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,6 @@ nosetests.xml
3535
coverage.xml
3636
coverage_html
3737

38-
# Translations
39-
*.mo
40-
4138
# Mr Developer
4239
.mr.developer.cfg
4340
.project

.travis.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
11
language: python
22
python:
33
- "2.7"
4+
- "3.5"
45
env:
5-
- DJANGO=1.7.7
6-
- DJANGO=1.8
6+
- DJANGO=1.8.13
7+
- DJANGO=1.9.7
78
install:
89
- pip install -q Django==$DJANGO --use-mirrors
910
- pip install coveralls
1011
- pip install -r rest_auth/tests/requirements.pip
12+
matrix:
13+
exclude:
14+
- python: "3.5"
15+
env: DJANGO=1.8.13
1116
script:
1217
- coverage run --source=rest_auth setup.py test
1318
after_success:

demo/demo/urls.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
name='email-verification'),
1212
url(r'^login/$', TemplateView.as_view(template_name="login.html"),
1313
name='login'),
14+
url(r'^logout/$', TemplateView.as_view(template_name="logout.html"),
15+
name='logout'),
1416
url(r'^password-reset/$',
1517
TemplateView.as_view(template_name="password_reset.html"),
1618
name='password-reset'),

demo/requirements.pip

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
django>=1.7.0
2-
django-rest-auth==0.6.0
3-
django-allauth==0.24.1
1+
django>=1.8.0
2+
django-rest-auth==0.8.1
3+
django-allauth>=0.24.1
44
six==1.9.0

demo/templates/base.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
<li class="divider"></li>
4141
<!-- these pages require user token -->
4242
<li><a href="{% url 'user-details' %}">User details</a></li>
43+
<li><a href="{% url 'logout' %}">Logout</a></li>
4344
<li><a href="{% url 'password-change' %}">Password change</a></li>
4445
</ul>
4546
</li>
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{% block content %}
2+
3+
<form class="form-horizontal ajax-post" role="form" action="{% url 'rest_logout' %}">{% csrf_token %}
4+
<div class="form-group">
5+
<label for="token" class="col-sm-2 control-label">User Token</label>
6+
<div class="col-sm-4">
7+
<input name="token" type="text" class="form-control" id="token" placeholder="Token">
8+
<p class="help-block">Token received after login</p>
9+
</div>
10+
</div>
11+
12+
<div class="form-group">
13+
<div class="col-sm-offset-2 col-sm-10">
14+
<button type="submit" class="btn btn-default">Login</button>
15+
</div>
16+
</div>
17+
18+
<div class="form-group api-response"></div>
19+
</form>
20+
{% endblock %}

demo/templates/logout.html

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{% extends "base.html" %}
2+
3+
{% block content %}
4+
<div class="row">
5+
<h3>Logout</h3><hr/>
6+
{% include "fragments/logout_form.html" %}
7+
</div>
8+
{% endblock %}

docs/api_endpoints.rst

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,11 @@ Basic
1111
- password (string)
1212

1313

14-
- /rest-auth/logout/ (POST)
14+
- /rest-auth/logout/ (POST, GET)
15+
16+
.. note:: ``ACCOUNT_LOGOUT_ON_GET = True`` to allow logout using GET (this is the exact same conf from allauth)
17+
18+
- token
1519

1620
- /rest-auth/password/reset/ (POST)
1721

@@ -70,3 +74,8 @@ Basing on example from installation section :doc:`Installation </installation>`
7074

7175
- access_token
7276
- code
77+
78+
- /rest-auth/twitter/ (POST)
79+
80+
- access_token
81+
- token_secret

docs/changelog.rst

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

4+
0.8.0
5+
-----
6+
- added support for django-rest-framework-jwt
7+
- bugfixes
8+
9+
0.7.0
10+
-----
11+
- Wrapped API returned strings in ugettext_lazy
12+
- Fixed not using ``get_username`` which caused issues when using custom user model without username field
13+
- Django 1.9 support
14+
- Added ``TwitterLoginSerializer``
15+
416
0.6.0
517
-----
618
- dropped support for Python 2.6

0 commit comments

Comments
 (0)