Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3282582
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T19:56:38+00:00 2026-05-17T19:56:38+00:00

The automatic sitemap for my Django site fluctuates between including the www on urls

  • 0

The automatic sitemap for my Django site fluctuates between including the www on urls and leaving it out (I’m aiming to have it in all the time). This has ramifications in google not indexing my pages properly so I’m trying to narrow down what would be causing this issue.

I have set PREPEND_WWW = True and my site record in the sites framework is set to include the www e.g. it’s set to www.example.com as opposed to example.com. I’m using memcached but pages should expire from the cache after 48 hours so I wouldn’t have thought that would be causing the issue?

You can see the problem in effect at http://www.livingspaceltd.co.uk/sitemap.xml (refresh the page a few times).

My sitemaps setup is fairly prosaic so I’m doubtful that that is the issue, but in case it’s something obvious I’m missing here’s the code:

***urls.py***

sitemaps = {
    'subpages': Subpages_Sitemap,
    'standalone_pages': Standalone_Sitemap,
    'categories': Categories_Sitemap,
}

urlpatterns = patterns('',
    (r'^sitemap\.xml$', 'django.contrib.sitemaps.views.sitemap', {'sitemaps': sitemaps}),
    ...

***sitemaps.py***

# -*- coding: utf-8 -*- 
from django_ls.livingspace.models import Page, Category, Standalone_Page, Subpage
from django.contrib.sitemaps import Sitemap

class Subpages_Sitemap(Sitemap):
    changefreq = "monthly"
    priority = 0.4
    def items(self):
        return Subpage.objects.filter(restricted_to__isnull=True)

class Standalone_Sitemap(Sitemap):
    changefreq = "weekly"
    priority = 1
    def items(self):
        return Standalone_Page.objects.all()

class Categories_Sitemap(Sitemap):
    changefreq = "weekly"
    priority = 0.7
    def items(self):
        return Category.objects.all()
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T19:56:39+00:00Added an answer on May 17, 2026 at 7:56 pm

    PREPEND_WWW = True in settings.py must appear above your caching variable settings. This fixed my problem which is just the same with yours. I ran into this same problem when i submit my sitemap in google webmaster tool.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have an automatic reporting and notification system written in .net that sends emails
I'm creating a site that is going to have a wiki article database. Right
I want to have automatic backup of some directories on my pendrive whenever I
Possible Duplicate: Automatic counter in Ruby for each? I want to find out the
Does grails have an automatic constraint update. If we change the field in domain
I have a directory with sitemaps, which all end with a number. I have
I have setup some automatic form submission code. Basically when a form is submitted
I installed jobberBase using automatic installation (softaculous) on arvixe. As this was all automatic
I am testing out automatic deployment of build artifacts from Bamboo to Artifactory. I
I have turned of Automatic Reference Counting (ARC) in my Xcode 4.3.2, and thought

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.