26
loading...
This website collects cookies to deliver better user experience
Shortener
. Its fields are as seen in the snippet below. The save method is called to update the database with the shortened URL associated with the user's original URL.Form
class is what handles forms in Django. It accepts specifics such as form fields, layouts, valid values, and so forth. More on that can be read here. Forms can be inherited from Models and that's the road more travelled. It was also the road I took..env
file and store the environment variables.env
file.env
files in a gitignore
file. However, the latter is a lot quicker to implement than the former as it saves me a couple of lines, and going forward, it is definitely the way to go.