Creating an image bookmarking website
We will now learn how to allow users to bookmark images that they find on other websites and share them on our site. To build this functionality, we will need the following elements:
- A data model to store images and related information
- A form and a view to handle image uploads
- JavaScript bookmarklet code that can be executed on any website. This code will find images across the page and allow users to select the image they want to bookmark
First, create a new application inside your bookmarks
project directory by running the following command in the shell prompt:
django-admin startapp images
Add the new application to the INSTALLED_APPS
setting in the settings.py
file of the project, as follows:
INSTALLED_APPS = [
# ...
'images.apps.ImagesConfig',
]
We have activated the images
application in the project.
Building the image model
Edit the models.py
file of the images
application...