forked from hooram/ownphotos
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add support for making photos public, allow admin to allow/disallow n…
…ew signup
- Loading branch information
Hooram Nam
committed
Jun 17, 2018
1 parent
60eaae8
commit b1f0c1b
Showing
9 changed files
with
339 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
class FingerPrintMiddleware(object): | ||
def __init__(self, get_response): | ||
self.get_response = get_response | ||
# One-time configuration and initializatio | ||
|
||
def __call__(self, request): | ||
response = self.get_response(request) | ||
import hashlib | ||
fingerprint_raw = "".join((request.META.get("HTTP_USER_AGENT", ""), | ||
request.META.get("HTTP_ACCEPT_ENCODING", | ||
""))) | ||
# print(fingerprint_raw) | ||
fingerprint = hashlib.md5(fingerprint_raw.encode('utf-8')).hexdigest() | ||
request.fingerprint = fingerprint | ||
# print(fingerprint) | ||
return response |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.