JSL Django Sitemap is a Django utility which iterates over all the url patterns in your main Django project and creates a ready to use sitemap. The sitemap.xml is useful in crawlers such as Google, Bing, Yahoo. We hope you like our app! Leave a star on our GitHub repository. Thanks!
Project description
JSL Django Sitemap
JSL Django Sitemap is a sitemap.xml creator for Django projects which iterates over all the url patterns in your main Django project and creates a ready to use sitemap. The sitemap.xml is useful in crawlers such as Google, Bing, Yahoo. We hope you like our app! Leave a star on our GitHub repository. Thanks!
Our Home page JSoftwareLabs.com
Installation
You can install the JSL Django Sitemap from PyPI:
pip install jsl-django-sitemap
Example Usage
Add necessary imports
from jsl_django_sitemap.views import sitemaps
from django.contrib.sitemaps.views import sitemap
from django.urls import path
In your main django project urls.py file add below in urlpatterns
path('sitemap.xml', sitemap, {'sitemaps': sitemaps},
name='django.contrib.sitemaps.views.sitemap'),
In your main settings.py file add below
JSL_DJANGO_SITEMAP_SETTINGS = {
"ENABLE": True,
"FETCH_URL_FROM": "name",
"INCLUDE_APPS": ("ALL",)
}
add django built in sitemap in the INSTALLED_APPS
INSTALLED_APPS = [
# ...
'django.contrib.sitemaps',
]
NOTE:
- "ALL" means to include all the urls
- If you want specific apps to be included in sitemap use below. Provide comma separated tuple containing your app name
- "INCLUDE_APPS": ("myapp1","myapp2")
- FETCH_URL_FROM: should be one value from the list ["name", "pattern"]
- default for FETCH_URL_FROM is "pattern"
- By default, if pattern is provided then "^" prefix and "$" suffix in urlpattern is removed.
View generated sitemap:
Start the development server and visit http://127.0.0.1:8000/sitemap.xml
Current Releases
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for jsl_django_sitemap-1.1.6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 06f4a1318cb20ab7b78a22b9f1f1a836dd75ff4cbc5d4c6a5a46429c30a48527 |
|
MD5 | 881e231d1af9d5a0cb1d7b4a3c109fec |
|
BLAKE2b-256 | c3362231344d2932dc949833c4d846d64abf2e0a93472918846c6f85745beab6 |