From 17a12f07fb04e4e3d7155be39d5e90a57d6dce61 Mon Sep 17 00:00:00 2001 From: Jelle van der Waa Date: Tue, 8 Oct 2019 15:52:38 +0200 Subject: Introduce planet functionality in archweb This change introduces a replacment for planet.archlinux.org which uses a python 2 project to generate static html from multiple RSS feed sources. For archweb a set of 'static' feeds can be created in the django admin view for the Arch forums and other static feeds, archweb users can add their own blog rss feed in their profile which will create a Feed model. When running the update_planet command, all Feed models are iterated over and the rss feed is parsed. The latest FeedItem is queried matching the current Feed model and every newer entry in the RSS feed is added as new FeedItem. Since the body is also stored in the FeedItem there is a limit to the amount of FeedItems per Feed configured in settings.py of which the default is 25. When a user is marked as inactive his Feed model and items are removed automatically to avoid keeping stale data around. Closes: #261 --- urls.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'urls.py') diff --git a/urls.py b/urls.py index 44a1b0e4..c4e3992c 100644 --- a/urls.py +++ b/urls.py @@ -8,7 +8,7 @@ from django.conf import settings from django.views.decorators.cache import cache_page from django.views.generic import TemplateView -from feeds import PackageFeed, NewsFeed, ReleaseFeed, PackageUpdatesFeed +from feeds import PackageFeed, NewsFeed, ReleaseFeed, PackageUpdatesFeed, PlanetFeed import sitemaps import devel.urls @@ -17,6 +17,7 @@ import mirrors.urls_mirrorlist import news.urls import packages.urls import packages.urls_groups +import planet.views import public.views import releng.urls import todolists.urls @@ -48,6 +49,7 @@ urlpatterns.extend([ url(r'^master-keys/$', public.views.keys, name='page-keys'), url(r'^master-keys/json/$', public.views.keys_json, name='pgp-keys-json'), url(r'^people/(?P[-\w]+)/$', public.views.people, name='people'), + url(r'^planet/$', planet.views.index, name='planet'), ]) # Feeds patterns, used below @@ -63,6 +65,7 @@ feeds_patterns = [ url(r'^packages/all/(?P[A-z0-9\-]+)/$', cache_page(313)(PackageFeed())), url(r'^packages/(?P[A-z0-9]+)/(?P[A-z0-9\-]+)/$', cache_page(313)(PackageFeed())), url(r'^releases/$', cache_page(317)(ReleaseFeed())), + url(r'^planet/$', cache_page(317)(PlanetFeed()), name='planet-feed'), ] # Includes and other remaining stuff -- cgit v1.2.3-55-g3dc8