1

I've made a sitemap for my website using Django-sitemaps, the compilation went ok, the file is created, but I don't know from where can I access to it.

This is my urls.py

from django.conf.urls import patterns, include, url
from django.conf import settings
from django.contrib import admin
from django.contrib.sitemaps.views import sitemap
from sitemap import ContratalosSitemap

#Declaration for sitemaps url

sitemaps = {
    'pages' : ContratalosSitemap,
}

urlpatterns = patterns(
    'apps.contratalos.views',
    url(r'c/(?P<slug>\.*[^ ]{1,128})?/', 'c', name='content'),
    url(r'^sitemap\.xml$', sitemap, {'sitemaps': sitemaps}, name='django.contrib.sitemaps.views.sitemap'),
)

The file is created on shared folder, where my templates are, as far as I know, this should be accessed from root url, ie: www.contratalos.com/sitemap.xml

But it says Not found, I don't know if this is a nginx configuration or maybe I am missing something on this...

Any ideas?

Thanks in advance!

EDIT

This is my sitemap.py:

from django.contrib.sitemaps import Sitemap
from django.core.urlresolvers import reverse

from datetime import datetime

class ContratalosSitemap(Sitemap):

def __init__(self, names):
    self.names = names

def items(self):
    return self.names

def changefreq(self, obj):
    return 'weekly'

def lastmod(self, obj):
    return datetime.now()

def location(self, obj):
    return reverse(obj)
NeoVe
  • 3,857
  • 8
  • 54
  • 134

1 Answers1

1

Try:

http://yoursite.com/sitemap.xml

It is dynamically generated - it is not a file.

Mikko Ohtamaa
  • 82,057
  • 50
  • 264
  • 435
  • Yes, http://contratalos.com/sitemap.xml , but it is not found, what may be causing this? – NeoVe Jul 12 '15 at 06:30