Framework integration
Rankveo for Django
Publish in rankveo, render the blog on your Django site. One app in INSTALLED_APPS - no models, no migrations, and the sitemap framework you know.
rankveo-django Installation
Install the package in your existing Django project.
terminal
pip install rankveo-django Two steps
Add the app
Plus your key. That is the whole configuration.
INSTALLED_APPS = [
...,
"django.contrib.sitemaps",
"rankveo",
]
RANKVEO = {
"API_KEY": os.environ[
"RANKVEO_BLOG_API_KEY"
],
} Include the URLs
Listing, article, tag, category, feed and sitemap.
path("blog/",
include("rankveo.urls")), Or read it yourself
For pages you write by hand.
from rankveo.cache import blog
articles = blog().get_articles(page=0)
article = blog().find_article(slug) Django’s own frameworks, not reinvented ones
The feed is a django.contrib.syndication Feed and the
sitemap is a django.contrib.sitemaps Sitemap. You already
know how to extend both, and escaping and date formats come for free.
- Image entries the default leaves out The sitemap template adds them, because Google will not index an image it has to find by crawling.
- Override any template Put your own at the same path - the app loader finds yours first.
- Your cache backend LocMem, Redis, database, file. Invalidation works the same on all of them.
# your templates win over the app's
templates/
rankveo/
blog/
base.html # your site chrome
index.html
article.html Worth knowing before you start
Live in seconds
Set
REVALIDATE_SECRET and rankveo clears the blog cache
whenever an article changes. Without one the route is not registered
at all.
Cached as dicts, not dataclasses
Django pickles cache values, and a pickled dataclass raises the first
time a field is renamed - in production, until the cache expires.
Objects are rebuilt on read.
The client works outside Django too
rankveo.client imports nothing from Django, so the same
class runs in a management command or a Celery task.
Real paths, not query strings
Pagination is
/blog/page/2/, so every page is a distinct
URL a crawler can reach.