According to the documentation, django should load templates automatically from my app if i have a folder named 'templates' in the root dir of the app.
I've added my app
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
# 'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
# Uncomment the next line to enable the admin:
'django.contrib.admin',
# Uncomment the next line to enable admin documentation:
'django.contrib.admindocs',
# Use email as username https://github.com/dabapps/django-email-as-username
'emailusernames',
'purchaseapp' # this is my app
)
I've created a templates folder
and i've setup urlpatterns to use the admin as the login page
urlpatterns = patterns('',
# Examples:
# url(r'^$', 'timely.views.home', name='home'),
# url(r'^timely/', include('timely.foo.urls')),
# Uncomment the admin/doc line below to enable admin documentation:
url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
# Uncomment the next line to enable the admin:
url(r'^admin/', include(admin.site.urls)),
url(r'^$', hello),
url(r'^accounts/logout/$', 'django.contrib.auth.views.logout'),
url(r'^accounts/login/$', 'django.contrib.auth.views.login', {'template_name': 'admin/login.html'}),
url(r'^accounts/$', 'django.views.generic.simple.redirect_to', {'url': '/'}),
url(r'^accounts/profile/$', 'django.views.generic.simple.redirect_to', {'url': '/'}),
)
i overwrote base_site.html but i can't see my customization, which i see if it add the folder to TEMPLATE_DIRS
TEMPLATE_DIRS = (
"/Users/nicola/Documents/Aptana Studio 3 Workspace/timely/purchaseapp/templates",
# Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
# Always use forward slashes, even on Windows.
# Don't forget to use absolute paths, not relative paths.
)
What am i doing wrong?