Move intial setup code to a management command called initialsetup, update installation instructions
This commit is contained in:
22
setup.py
22
setup.py
@@ -1,17 +1,12 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import os
|
||||
import random
|
||||
import string
|
||||
import sys
|
||||
|
||||
try:
|
||||
from setuptools import setup
|
||||
except ImportError:
|
||||
from distutils.core import setup
|
||||
from distutils.command.install import install as _install
|
||||
else:
|
||||
from setuptools.command.install import install as _install
|
||||
|
||||
import mayan
|
||||
|
||||
@@ -23,22 +18,6 @@ if sys.argv[-1] == 'publish':
|
||||
sys.exit()
|
||||
|
||||
|
||||
def post_install(dir):
|
||||
secret = ''.join([random.SystemRandom().choice((string.digits + string.letters + string.punctuation).replace("'",'')) for i in range(100)])
|
||||
with open(os.path.join(dir, 'mayan', 'settings', 'local.py'), 'w+') as file_object:
|
||||
file_object.write('\n'.join([
|
||||
'from __future__ import absolute_import',
|
||||
'from .base import *',
|
||||
"SECRET_KEY = '{}'".format(secret),
|
||||
]))
|
||||
|
||||
|
||||
class install(_install):
|
||||
def run(self):
|
||||
_install.run(self)
|
||||
self.execute(post_install, (self.install_lib,), msg="Running post install task")
|
||||
|
||||
|
||||
def fullsplit(path, result=None):
|
||||
"""
|
||||
Split a pathname into components (the opposite of os.path.join) in a
|
||||
@@ -129,7 +108,6 @@ setup(
|
||||
'Topic :: Internet :: WWW/HTTP :: WSGI :: Application',
|
||||
'Topic :: Communications :: File Sharing',
|
||||
],
|
||||
cmdclass={'install': install},
|
||||
description='A Django based Document Management System.',
|
||||
include_package_data=True,
|
||||
install_requires=install_requires,
|
||||
|
||||
Reference in New Issue
Block a user