-
Notifications
You must be signed in to change notification settings - Fork 288
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 #766 from longguikeji/v2.5-dev-luolu
V2.5 dev luolu
- Loading branch information
Showing
11 changed files
with
114 additions
and
77 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
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
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
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
Empty file.
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,16 @@ | ||
from urllib.parse import urlsplit | ||
from django.shortcuts import render | ||
from django.urls import reverse | ||
from django.views import View | ||
|
||
|
||
class Redoc(View): | ||
def get(self, request, *args, **kwargs): # pylint: disable=no-self-use unused-argument | ||
# openapi_url = reverse('api/v1/openapi.json') | ||
# return render(request, 'redoc.html', context={"openapi_url":openapi_url}) | ||
http = urlsplit(request.build_absolute_uri(None)).scheme | ||
#获得当前的HTTP或HTTPS | ||
host = request.META['HTTP_HOST'] | ||
#获取当前域名 | ||
openapi_url = http + '://' + host + '/api/v1/openapi.json' | ||
return render(request, 'redoc.html', context={'openapi_url':openapi_url}) |
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
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
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
File renamed without changes.
Oops, something went wrong.