Login

Snippets by tomas

Snippet List

Localeurl sitemap

Example of using django localeurl with sitemaps. Create sitemap instance for each combination of the sitemap section and language. In your sitemap class create method ` def location(self, obj): return chlocale(obj.get_absolute_url(), self.language) ` or inherit it from LocaleurlSitemap class.

  • localeurl
  • sitemap
Read More

Custom nose runner

This method is replacement for django test runner. It uses nose test runner, which will discover all tests in the application (not even in tests module of applications). For installing put in settings.py: `TEST_RUNNER = 'nose_runner.run_tests'` where *nose_runner* is module containing the code

  • test
  • nose
  • testrunner
Read More

tomas has posted 2 snippets.