mirror of
https://github.com/Tivix/django-rest-auth.git
synced 2024-11-22 00:56:34 +03:00
Add swagger API docs to demo project
This commit is contained in:
parent
37375461df
commit
5330e0cfb1
|
@ -44,6 +44,7 @@ INSTALLED_APPS = (
|
|||
'rest_auth.registration',
|
||||
'allauth.socialaccount',
|
||||
'allauth.socialaccount.providers.facebook',
|
||||
'rest_framework_swagger',
|
||||
)
|
||||
|
||||
MIDDLEWARE_CLASSES = (
|
||||
|
@ -106,7 +107,7 @@ TEMPLATES = [
|
|||
},
|
||||
]
|
||||
|
||||
REST_SESSION_LOGIN = False
|
||||
REST_SESSION_LOGIN = True
|
||||
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
|
||||
SITE_ID = 1
|
||||
ACCOUNT_EMAIL_REQUIRED = False
|
||||
|
@ -119,3 +120,8 @@ REST_FRAMEWORK = {
|
|||
'rest_framework.authentication.TokenAuthentication',
|
||||
)
|
||||
}
|
||||
|
||||
SWAGGER_SETTINGS = {
|
||||
'LOGIN_URL': 'login',
|
||||
'LOGOUT_URL': 'logout',
|
||||
}
|
||||
|
|
|
@ -2,6 +2,8 @@ from django.conf.urls import include, url
|
|||
from django.contrib import admin
|
||||
from django.views.generic import TemplateView, RedirectView
|
||||
|
||||
from rest_framework_swagger.views import get_swagger_view
|
||||
|
||||
urlpatterns = [
|
||||
url(r'^$', TemplateView.as_view(template_name="home.html"), name='home'),
|
||||
url(r'^signup/$', TemplateView.as_view(template_name="signup.html"),
|
||||
|
@ -38,4 +40,5 @@ urlpatterns = [
|
|||
url(r'^account/', include('allauth.urls')),
|
||||
url(r'^admin/', include(admin.site.urls)),
|
||||
url(r'^accounts/profile/$', RedirectView.as_view(url='/', permanent=True), name='profile-redirect'),
|
||||
url(r'^docs/$', get_swagger_view(title='API Docs'), name='api_docs')
|
||||
]
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
django>=1.8.0
|
||||
django-rest-auth==0.8.1
|
||||
djangorestframework==3.5.1
|
||||
django-allauth>=0.24.1
|
||||
six==1.9.0
|
||||
django-rest-swagger==2.0.7
|
||||
|
|
|
@ -60,6 +60,7 @@
|
|||
<li class="active"><a href="/">Demo</a></li>
|
||||
<li><a target="_blank" href="http://django-rest-auth.readthedocs.org/en/latest/">Documentation</a></li>
|
||||
<li><a target="_blank" href="https://github.com/Tivix/django-rest-auth">Source code</a></li>
|
||||
<li><a target="_blank" href="{% url 'api_docs' %}">API Docs</a></li>
|
||||
</ul>
|
||||
</div><!--/.nav-collapse -->
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue
Block a user