Beginning a thread🧵 about the basics in #Python you need to know for #Django👇
Django is a #webframework to build interactive #websites for Python and is great for fast #development
Django is a #webframework to build interactive #websites for Python and is great for fast #development
2/19
No special signs are allowed to be used in the name of variables, except for ‘_’ like.
Numbers are allowed in the name of a variable, but not at the start
So ‘1car’ is not OK and ‘car1’ is OK.
No special signs are allowed to be used in the name of variables, except for ‘_’ like.
Numbers are allowed in the name of a variable, but not at the start
So ‘1car’ is not OK and ‘car1’ is OK.
3/19
Lists
Lists store multiple pieces of information in a specific order.
A list always starts and ends with a square bracket ‘[‘ ‘]’.
Python starts counting at 0.
So the position or index number of the first item in the list is 0.
to print the first item, use #Code1
Lists
Lists store multiple pieces of information in a specific order.
A list always starts and ends with a square bracket ‘[‘ ‘]’.
Python starts counting at 0.
So the position or index number of the first item in the list is 0.
to print the first item, use #Code1
We can add items to the list by using the ‘append’ function.
See #Code2
A ‘for loop’ or looping allows you to perform the same action for multiple items in a list or group of items
See #Code2
A ‘for loop’ or looping allows you to perform the same action for multiple items in a list or group of items
14/19
Include the app in the settings.py file inside your project.
Django doesn’t know our app exists yet, this way we tell django that there is an app called ‘myfirstapp’
Include the app in the settings.py file inside your project.
Django doesn’t know our app exists yet, this way we tell django that there is an app called ‘myfirstapp’
19/19
you have learned how to create a basic django structure with one webpage
you have learned how to create a basic django structure with one webpage
Loading suggestions...