
== Overview ==

django-auto-urls is Django pluggable app that try to load template by it's file name passed in url.

It is useful in development for quick template rendering without overhead of defining 
urls for each template. It may be helpful for work with designers as designers will be 
able to write Django templates (with inheritance and all the template tags) instead of 
raw HTML and don't care about writing views and urlconfs.

Please disable it in production (take a look at usage instructions) as direct template loading is possible insecure.


== Installation ==

$ easy_install django-auto-urls

or

$ hg clone http://bitbucket.org/kmike/django-auto-urls/ 
$ cd django-auto-urls
$ python setup.py install

Then add 'auto_urls' to your INSTALLED_APPS in settings.py.


== Usage ==

The best way to use this app is to add following lines to bottom of your project's urls.py file:

import settings
if settings.DEBUG:
    urlpatterns += patterns('',
        ('', include('auto_urls.urls')),
    )
    
This usually can be combined with django's static serving, smth. like this:

if settings.DEBUG:
    urlpatterns += patterns('',
        (r'^static/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT}),
        ('', include('auto_urls.urls')),
    )
    
Then create some templates in one of theese places:
 - project's 'templates' dir
 - any app's 'templates' dir
 - project's 'templates/auto_urls'
 - any app's 'templates/auto_urls'.
 
For example, if you create either 'templates/index.html' or 'templates/auto_urls/index.html' 
or 'myapp/templates/index.html' or 'myapp/templates/auto_dirs/index.html' file, 
it will be accesible as 'http://yoursite/index.html' and 'http://yoursite/index'
('html' and 'htm' extensions can be omitted in url).

The 'if settings.DEBUG:' stuff ensures that this app will be disabled in production. 