现在好了,我想我会写下我的答案:
视图.py:
import script as gh
def get_hostname(request):
gh.main()
return HttpResponseRedirect('/')
Run Code Online (Sandbox Code Playgroud)
网址.py:
...
url(r'^get_hostname/$', 'thinco.views.get_hostname'),
...
Run Code Online (Sandbox Code Playgroud)
模板中的某处:
...
<form action="/get_hostname/" method="GET">
<input type="submit" value="Liste der Thin Clients laden">
</form>
...
Run Code Online (Sandbox Code Playgroud)