2020-10-11 08:58:55 +00:00
|
|
|
import os
|
|
|
|
from django.conf import settings
|
|
|
|
from django.http import HttpResponse, Http404
|
2020-10-11 09:16:54 +00:00
|
|
|
from django.shortcuts import render
|
|
|
|
|
|
|
|
def app_intro(request):
|
|
|
|
return render(request, 'polls/app.html')
|
|
|
|
|
2020-10-11 08:58:55 +00:00
|
|
|
|
|
|
|
def download(request):
|
|
|
|
file_path = os.path.join(settings.MEDIA_ROOT, 'pom.apk')
|
|
|
|
if os.path.exists(file_path):
|
|
|
|
with open(file_path, 'rb') as fh:
|
|
|
|
response = HttpResponse(fh.read(), content_type="application/vnd.android.package-archive")
|
|
|
|
response['Content-Disposition'] = 'inline; filename=' + os.path.basename(file_path)
|
|
|
|
return response
|
|
|
|
raise Http404
|