[Django] CRUD(Create/Retrieve/Update/Delete)
Retrieve – read, retrieve, search, or view existing entries as a list(List View) or retrieve a particular entry in detail (Detail View)
Update – update or edit existing entries in a table in the database
Delete – delete, deactivate, or remove existing entries in a table in the database
We're going to learn how to work with a database outside of using the django admin panel.
create room_form.html inside main/templates/main
POST; for creating and updating , if I don't specify the action, it's going to send it to the current url that we're at. csrf_token this token will be sent on every form submit so when we're sending post requests in django we need to pass in this token; we're just sending that token along with every request and it's making sure that the user didn't try to do anything malicious with that.
and go to views.py
and url.py
Le'ts go into our home.tml page and this is where a user can create a room from.
Now you see "submit" on the page.
we're going to make new file..
main/forms.py
fields = '__all__' is going to create the form based on the metadata of the room