I have my index.html in /static/ folder. My django app is running ok when i try:
http://127.0.0.1:8000/index.html
But i want to acces index.html by url:
http://127.0.0.1:8000/
I wrote a view and it works:
class IndexView(TemplateView):
template_name = 'index.html'
I also added to urls.py(this lets me serve static like http://127.0.0.1:8000/css/style.css
):
url(r'^(?P<path>.*)$', 'django.contrib.staticfiles.views.serve', {
'document_root': settings.STATIC_ROOT, 'show_indexes':True
}),
But i think there is a way to do what i want without TemplateView.
Any suggestions? Thanks. My django version is: Django 1.5
EDIT:
The reason i placed index.html into static: i want to make Phonegap compatible django app, so after proper coding, all i have to do is --> make .zip from static folder and upload it to Phonegap as mobile app. Easy and clean.