Django Flashcards
manage.py
program you run to modify your project
db.sqlite
your database
cs3550/urls.py
routes URLs to the functions that generate them
cs3550/settings.py
global project settings
models.py
describes what you will store in the database
migrations/
tracks changes to the database
views.py
renders the HTML templates
IntegerField
Stores integers
FloatField
stores floating-point numbers
DecimalField
stores decimal numbers, use for money over float.
CharField
stores short strings, pass max_length
TextField
stores long strings
EmailField
store an email address
URLField
stores URLs
ImageField
images
FileField
storing files
DateTimeField
stores a specific instant in time
DateField
stores a calendar date
on_delete=models.RESTRICT
raise an error and prevent deletion
on_delete=models.CASCADE
also delete the object with the foreign key
on_delete=models. SET_NULL
must set null=True on the ForeignKey
floatformat:digits
Prints a float or decimal with that many decimal digits
date:“D d F Y”
Writes a date in a specific format
timesince:time
Prints how much time passed between two times