coltrane icon indicating copy to clipboard operation
coltrane copied to clipboard

Generate RSS/Atom feeds

Open adamghill opened this issue 3 years ago • 1 comments
trafficstars

adamghill avatar Jan 13 '22 01:01 adamghill

https://docs.djangoproject.com/en/4.0/ref/contrib/syndication/

adamghill avatar Feb 21 '22 22:02 adamghill

When I try to access the /rss.xml path in my project (coltrane integrated in an existing django project), I get a message telling me to add COLTRANE_SITE to my .env file but adding it doesn't seem to do anything.

I'm going to invest this a little more to make sure I'm not the one doing something stupid. But in general I feel that more settings should be customizable through the COLTRANE setting when integrated into an existing project.

When I have concrete proposals to make, I will open up some issues. Thank you for your time

Tobi-De avatar Sep 27 '22 21:09 Tobi-De

I have to admit that the integrated mode is the least tested although I do personally use coltrane that way, e.g. https://devmarks.io/about. I see the same error you mentioned when hitting https://devmarks.io/rss.xml so I'm going to update this issue to be specifically about that. 👍

adamghill avatar Sep 28 '22 00:09 adamghill

Adding something like this to your regular settings file should clear up that error.

image

But, I can definitely make that error clearer.

I'm also wondering if falling back to the Site framework would make sense at least for integrated mode?

adamghill avatar Sep 29 '22 02:09 adamghill

I'm also wondering if falling back to the Site framework would make sense at least for integrated mode?

I just read the Django sites framework documentation and I don't think using it make sense (I could be wrong). Sites are meant to serve multiple domains using the same Django project, as far as I know Coltrane doesn't handle this case at the moment, the only thing it needs is the domain of the website, maybe DOMAIN or SITE_URL as a variable name would be more appropriate. What is this setting really for?

Tobi-De avatar Sep 29 '22 06:09 Tobi-De

https://github.com/adamghill/coltrane/blob/e573dbdba9c7835babbb2e313f5ff4775354dd4e/coltrane/config/settings.py#L48 is only used for the rss feed. I needed some way to build an absolute URL so I need the domain for the site.

One way to do that would be looking for SITE_ID, but I agree that it's... maybe not intuitive that coltrane would use that.

I wonder if changing COLTRANE.SITE to COLTRANE.SITE_URL or COLTRANE.DOMAIN would be more clear? I'm onboard with either of those changes.

adamghill avatar Sep 29 '22 15:09 adamghill

I wonder if changing COLTRANE.SITE to COLTRANE.SITE_URL or COLTRANE.DOMAIN would be more clear? I'm onboard with either of those changes.

Yes, I think it would be clearer, COLTRANE.SITE_URL seems more appropriate since the full url will be better than just having the domain name.

Tobi-De avatar Sep 29 '22 15:09 Tobi-De

Perfect, I'll make that change. 👍

adamghill avatar Sep 29 '22 22:09 adamghill

#41 adds more documentation, better error message, and changes SITE to SITE_URL to hopefully be more clear so I'm going to close this issue now.

adamghill avatar Sep 30 '22 01:09 adamghill