Skip to main content

Reusable django app to handle /favicon.ico and robots.txt for your site

Project description

A reusable app to add favicon.ico and robots.txt handling for your site.

Installation

Install “django-site-basics” using pip or easy_install:

pip install django-site-basics

Add “favicon” to your INSTALLED_APPS in settings.py:

INSTALLED_APPS = (
    ...
    'site_basics',
)

Add site_basics URL patterns to urls.py:

urlpatterns = patterns('',
    ...
    url(r'^', include('site_basics.urls')),
)

Usage

Put favicon.ico into your STATIC_ROOT. and you good to go, /favicon.ico will automatically redirect to /static/favicon.ico if your STATIC_URL = ‘/static/’.

Otherwise you can set a custom path to your favicon using FAVICON_PATH setting. For example:

FAVICON_PATH = STATIC_URL + 'images/favicon.png'

robots.txt will be working out of the box but if you need to customize it put custom robots.txt file into your templates directory. If you need to change template location use ROBOTS_TEMPLATE setting (robots.txt by default). Example:

ROBOTS_TEMPLATE = 'myfolder/robots.txt'

Running the Tests

You can run the tests with via:

python setup.py test

or:

python runtests.py

TODO

  • 404 and 500 pages

  • Google Analytics

  • Sitemaps support

Credits

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-site-basics-0.1.3.tar.gz (4.0 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page