Django Level One Getting Started with Django!


Download 0.73 Mb.
bet12/14
Sana05.01.2022
Hajmi0.73 Mb.
#225180
1   ...   6   7   8   9   10   11   12   13   14
Bog'liq
Django Level One

Django

  • The next step is to let Django know of the templates by editing the DIR key inside of the TEMPLATES dictionary in the settings.py file.
  • However, there is an issue we have to deal with before we do this!

Django

  • We want our Django Project to be easily transferrable from one computer to another, but the DIR key will require a “hard-coded” path
  • How do we resolve this?

Django

  • We can use Python’s os module to dynamically generate the correct file path strings, regardless of computer!
  • Import os and try out the following:
    • print(__file__)
    • print(os.path.dirname(__file__)

Download 0.73 Mb.

Do'stlaringiz bilan baham:
1   ...   6   7   8   9   10   11   12   13   14




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling