Hi, @vitor, love the site! I think a really interesting topic would be about setting up a django project to follow SEO best practices.
That’s a good topic – actually Django have many built-in goodies for content-driven Django sites like RSS/Atom, redirects framework, sitemaps, etc.
Not sure if there’s a good third-party app to provide some support to SEO, but for the most part it will be implemented on the templates/HTML
After reading a little about it, I’m starting to use django-meta in combination with the built-in sitemaps. I figure that there’s even more than can be done (and probably with much more eloquence ) – SEO really isn’t my forte. I’d love to see how folks with more knowledge & experience do it!
I have been using this app constantly. I also use django-robots.
I just hardcode the basic data for seo in base.html and then reappy it for dynamic pages or simply hardcode it to html it for some various static pages like Contact Us, FAQ etc.
Thanks for telling us about
django-robots, @Cleiton, that’s one I hadn’t come across before! Do you have any tips for
django-robots? My only experience with trying to make sites SEO-friendly was helping people with WordPress sites…and in that case, most everything was taken care of for you by plugins. Guess I just need to read more about it
Wait! So django-robots is only for sitemap and robots.txt file?
Sitemap is intrigated in Django and robots.txt needs only one line code in urls.py why would you use third party plugin for it.
For SEO a good plugin for meta tags is all you need.
What I use for SEO is
To use django-meta it has no secret. You can either configure it at the model level or apply some attributes to the view. As seen in the documentation itself.
I’m no SEO expert either!
robots.txt has is used for other purposes.
django-robots you can configure the urls and the rules to access them.
Yeah Still I use the simplest of them all
User-Agent: * Disallow:
Just curious, Is there any way to stop scrappers from robots.txt file?
In some projects I add
/admin url in
Disallow. Each case is different
I don’t do this intentionally to hide my admin panel url, I never set it to /admin
If you need to add meta tags and OG properties to a template response of your views, you can try my package: django-ok-seo. Maybe, you will find it usefull.