Setting up Google Webmaster Tools with Python / Django

by Rich Jones on Feb 14, 2012.
_________________

This a short guide on how to set up Google Webmaster tools for your python django website.

Getting Started

To start, go to Google Webmaster Tools and click 'Add A Site.' It's a red button that looks like this:

Python Webmaster Tools

Enter the URL of your website. You'll be taken to a screen with a list of instructions. In the first instruction, there is a link to an HTML file. Download it somewhere.

Inside the HTML file, there will be a string of text that says something like 'google-site-verification: googlea14532fb912s486.html'

Copy that text, and then, in your Django project's urls.py, add this line:

with the strings are replaced with your values. If you need to, refresh your server.

Finishing Up

Then, go back to Webmaster Tools and press 'Verify'. Hooray! Now you've got access to Webmaster Tools and all it's linky goodness.

Bonus! You can use this for your robots.txt:

This will grant robots permissions to crawl your entire website!

Learn and Earn!

Sign up for great tutorials, guides, rants, raves and opportunities to earn more money!