mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-10 11:21:29 +00:00
Write pid to file in windows
This commit is contained in:
10
settings.py
10
settings.py
@@ -331,6 +331,13 @@ else:
|
|||||||
load_local_settings(local_settings)
|
load_local_settings(local_settings)
|
||||||
del local_settings
|
del local_settings
|
||||||
|
|
||||||
|
|
||||||
|
if 'win32' in sys.platform:
|
||||||
|
INSTALLED_APPS += ('django_wsgiserver', )
|
||||||
|
fp = open(os.path.join(install_topdir, "seahub.pid"), 'w')
|
||||||
|
fp.write("%d\n" % os.getpid())
|
||||||
|
fp.close()
|
||||||
|
|
||||||
# Load seahub_settings.py in server release
|
# Load seahub_settings.py in server release
|
||||||
try:
|
try:
|
||||||
sys.path.insert(0, install_topdir)
|
sys.path.insert(0, install_topdir)
|
||||||
@@ -340,11 +347,14 @@ except ImportError:
|
|||||||
else:
|
else:
|
||||||
# In server release, sqlite3 db file is <topdir>/seahub.db
|
# In server release, sqlite3 db file is <topdir>/seahub.db
|
||||||
DATABASES['default']['NAME'] = os.path.join(install_topdir, 'seahub.db')
|
DATABASES['default']['NAME'] = os.path.join(install_topdir, 'seahub.db')
|
||||||
|
if 'win32' not in sys.platform:
|
||||||
# In server release, gunicorn is used to deploy seahub
|
# In server release, gunicorn is used to deploy seahub
|
||||||
INSTALLED_APPS += ('gunicorn', )
|
INSTALLED_APPS += ('gunicorn', )
|
||||||
|
|
||||||
load_local_settings(seahub_settings)
|
load_local_settings(seahub_settings)
|
||||||
del seahub_settings
|
del seahub_settings
|
||||||
|
|
||||||
|
|
||||||
# Remove install_topdir from path
|
# Remove install_topdir from path
|
||||||
sys.path.pop(0)
|
sys.path.pop(0)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user