diff --git a/django/db/backends/creation.py b/django/db/backends/creation.py index 6ac55eb5ff0..659d35ace37 100644 --- a/django/db/backends/creation.py +++ b/django/db/backends/creation.py @@ -1,3 +1,4 @@ +import hashlib import sys import time @@ -27,7 +28,10 @@ class BaseDatabaseCreation(object): Generates a 32-bit digest of a set of arguments that can be used to shorten identifying names. """ - return '%x' % (abs(hash(args)) % 4294967296) # 2**32 + h = hashlib.md5() + for arg in args: + h.update(arg) + return h.hexdigest()[:8] def sql_create_model(self, model, style, known_models=set()): """