Next, we will create a page that is similar to the Twitter listing for hashtags. For this task, we will almost follow the same architecture that we followed for the user profile. Let's start by adding a URL entry for the hashtag page. Open the
urls.py file and insert the following entry (preferably below the user page entry so as to keep the table organized):
The captured part of this regular expression is the same as that of the user page. We will only allow alphanumeric characters in a hashtag.
We will define the
hashtag class in the controller as follows:
class HashTagCloud(View): """Hash Tag page reachable from /hastag/<hashtag> URL""" def get(self, request, hashtag): params ...