Django static file [text,css,image,javascript] and some important command-4

 

18.Django version check : go to computer command write command
    python -m django --version
19.terminal back command is cd ../
20.External css link like <link rel="stylesheet" type="text/css" href="style.css">

21.{{}} -used for simple text injection in html file
   {% %}- used for more complex injection and logic

23. <link rel="stylesheet" type="text/css"  href="{%static 'css/style.css'%}">
    <img src="{%static '/firsr_app/image/logo.jpg' %}">
    Static file add korte hoi aivabe.
    Static file jai html page e load korte hoi sei page e sobar upore
    {% load static %}
    aivabe static load koreneta hoi


24.Static file[pic/css/javascript] 2 vabe rakhe add kora jai.
   1.app er vetore baniye
   2.base folder a baniye
   ......................
   a.app er vetore banale normally use korte parba settings a change dorkar nai
   b.base folder ba external folder a banale settings.py a kichujinish add deta hobe
   .......................
   import os  [at the top of settings page]
   ..............................
    STATICFILES_DIRS=[
         os.path.join(BASE_DIR,'static')  [at the bottom of settings page]
     ]
    ...................................


Comments

Popular posts from this blog

D WEB LINK