Commit dc68246c authored by svilayphiou's avatar svilayphiou

mimetype for rss

parent 056f283c
......@@ -185,8 +185,10 @@ class Pad(models.Model):
@property
def getLastEdited(self):
from datetime import datetime
import email.utils
timestamp = self.epclient.getLastEdited(self.padid)
return datetime.fromtimestamp(timestamp['lastEdited']/1000)
dt = datetime.fromtimestamp(timestamp['lastEdited']/1000)
return email.utils.format_datetime(dt)
@property
def getFirstLines(self):
......
<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
{% load wikify %}
<?xml
version="1.0" encoding="utf-8"?>
<rss version="2.0"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
>
<channel>
<title>{{ site_name }}</title>
<link>{{ SITE_DOMAIN }}</link>
......
......@@ -439,7 +439,7 @@ def rss(request):
'SITE_DOMAIN': SITE_DOMAIN,
}
return render(request, "rss.xml", context)
return render(request, "rss.xml", context, "text/xml")
def padOrFallbackPath(request, slug, fallbackPath, mimeType):
try:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment