Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8677853
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T20:34:12+00:00 2026-06-12T20:34:12+00:00

i am newbie to django and learning by doing small application. in views.py i

  • 0

i am newbie to django and learning by doing small application.
in views.py i have intentionally included a template file(.html) which does not exist.

t = get_template('current_datetimeP.html')

in setting.py
TEMPLATE_DIRS = (
“D:/Django_Code/mysite/templates/”,
)

i get this error TemplateDoesNotExist at /time/

Django tried loading these templates, in this order:
Using loader django.template.loaders.filesystem.Loader:
D:\Django_Code\mysite\templates\current_datetimeP.html (File does not exist)

since i have included D:\Django_Code\mysite\templates\ in settings.py its fine that the Django is loking in there but what about following

I also get this

Using loader django.template.loaders.app_directories.Loader:
C:\Python27\lib\site-packages\django\contrib\auth\templates\current_datetimeP.html (File does not exist)

Why Django looking in here *C:\Python27\lib\site-packages\django\contrib\auth\templates*.
Is it a default location to search templates ?

one more thing , its is evident that Django is looking in above directory. can we place templates file in there instead of putting in application directory. (Although it is not a good practice ) ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T20:34:13+00:00Added an answer on June 12, 2026 at 8:34 pm

    Template loading is controlled by the TEMPLATE_LOADERS setting in settings.py, which usually looks something like this:

    TEMPLATE_LOADERS = (
        'django.template.loaders.app_directories.Loader',
        'django.template.loaders.filesystem.Loader',
    )
    

    The app directories loader looks for templates in a “templates” folder in any of the apps listed in INSTALLED_APPS in settings.

    The filesystem loader attempts to load templates from the fully qualified directory path names listed under TEMPLATE_DIRS in the settings file.

    If you wish to give the filesystem loader preference, let it come before the app directories loader in the TEMPLATE_LOADERS setting. If you’d like to turn off app directories loading, comment it out with a # ( or delete it from the tuple ).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Being a Django newbie, I have a question to ask, which should be very
I am newbie at Django. I have model with a custom method. In view
Newbie question. I have Django models that look like this: class Video(models.Model): uploaded_by =
Newbie question... The objective: I intend to have an HTML text input field as
Django Newbie question. I have the following model: class Leg(models.Model): drive_date = models.DateField() startpoint
Django newbie here, I have several types of models, in each of them the
Django newbie here, I'm using render_to_response('example.html', { 'error_message': error_message, }, context_instance=RequestContext(request)) How do I
I'm a django newbie. I have this model: class Item(models.Model): name = models.CharField(max_length=255) quantity
So I'm still a newbie in Django and I would like to have your
I have a Django project, and I'm somewhat of a newbie in it. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.