Join Caleb Smith for an in-depth discussion in this video Defining Django fields, part of Learning Python and Django.
- Looking at the example of the item model…that we made, the three fields are…a CharField, a TextField, and an IntegerField.…These define the different data types…that are being stored.…Let's take a look at some of the various field types.…This is not an exhaustive list, but shows…some that you are likely to see and use.…For numbers, there are the IntegerField…and DecimalField, for storing integers…and decimal numbers respectively.…For textual data, there's the Charfield and TextField.…The CharField requires a max length attribute…and stores an amount of characters up to that length.…
Th TextField differs in that the length…of the text is unbounded.…There are also a group of fields that are like…the CharField but perform some built-in…input validation, such as the EmailField and URLField.…These are used for storing email addresses…and URL fields respectively.…Note, that these validators check that…the email address or URL is valid in terms…of their format, but does not necessarily…ensure that the resource is valid or available.…
- Creating a new Django project
- Defining Django models and fields
- Querying data with the Django ORM
- Building views and templates
Skill Level Intermediate
Q: pip says it was installed correctly, and I've updated the PATH variable as shown, but the pip --version command isn't working. Why?
A: Depending on your computer's setup, you'll need to restart your terminal/command prompt before the additions you've made to the PATH variable are respected. With some setups, even that won't be enough, and you may need to restart the entire machine before you are able to use the pip command directly.