python - Django template Path -


I am following the tutorial in the Windows 7 environment. My settings file:

  TEMPLATE_DIRS = ( 'C: / django-project / myapp / mytemplates / admin')  

I Dimango source code (Dijeँgo / Contrib / admin / templates) template from within the default admin template directory admin / base_site.html from base_template in the tutorial instructions as directory administrator subdirectory myapp .

This is not affected by any reason what could be a sign of the problem? Do I have to do a sync db?

I know that this is not in the Django tutorial, and it's a shame for them, but your pATH variable is preferable to set the relative path you can set it up this way:

  import os PROJECT_PATH = os.path.realpath (os.path.dirname (__ Fail__)). .. MEDIA_ROOT = are PROJECT_PATH + '/ media /' TEMPLATE_DIRS = (PROJECT_PATH + '/ templates /',)  

If you like this can move your Dijengo project and your root root Will be updated automatically. This is useful when you are setting up your production server.

Second, there is some doubt on your TEMPLATE_DIRS path that it should point to the root of your template directory. Also, it should also end in a previous / .

I'm guessing here that the ... / admin / directory is not your template root. If you still want to write the full path, you should refer to the Template Template directory. needed.

TEMPLATE_DIRS = ( 'C: / / django-project / myapp / mytemplates')

That being said, find the template files The template loader must be set to enter your AP directory by default.

  Templet_loaders = ( 'Djngo Templetkloaderskfilesystemklod_templet_sors' Djngoktempletkloaderskapp_dayrektrijklod_templet_sors' #' Djngoktempletkloaders.agsklod_templet_sors')  

You should not do this if you want to overwrite something specifically, unless you need to copy the admin template.

If you have not played it yet, you will be running a sync debug. If you are hosting DNS by Runner, you will need your media files to be statically server.


Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -