我是通過django_ical服務器的icalender文件。問題是該文件被命名爲download.ics。我試圖將其更改爲MyCalender.ics。如果發現這個舊片段。我更喜歡使用django_ical,因爲它與django syndication很好地融合在一起。Django - 爲文件服務
cal = vobject.iCalendar()
cal.add('method').value = 'PUBLISH' # IE/Outlook needs this
for event in event_list:
vevent = cal.add('vevent')
icalstream = cal.serialize()
response = HttpResponse(icalstream, mimetype='text/calendar')
response['Filename'] = 'filename.ics' # IE needs this
response['Content-Disposition'] = 'attachment; filename=filename.ics'
你可以發佈你的django_ical代碼嗎? – dm03514