Remove Django dep.
authorRadek Czajka <radekczajka@nowoczesnapolska.org.pl>
Mon, 29 Sep 2014 12:55:33 +0000 (14:55 +0200)
committerRadek Czajka <radekczajka@nowoczesnapolska.org.pl>
Mon, 29 Sep 2014 12:55:33 +0000 (14:55 +0200)
fnpdeploy/__init__.py

index 058accf..dc74699 100644 (file)
@@ -21,7 +21,6 @@ Then set up some env properties:
 """
 from subprocess import check_output
 from os.path import abspath, dirname, exists, join
-from django.utils.crypto import get_random_string
 from fabric.api import *
 from fabric.context_managers import settings
 from fabric.contrib import files
@@ -31,6 +30,14 @@ env.virtualenv = '/usr/bin/virtualenv'
 env.services = None
 
 
+def get_random_string(length=12,
+                      allowed_chars='abcdefghijklmnopqrstuvwxyz'
+                                    'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'):
+    from random import SystemRandom
+    random = SystemRandom()
+    return ''.join(random.choice(allowed_chars) for i in range(length))
+
+
 @task
 def setup():
     """