1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-09 19:01:42 +00:00

Write pid to file in windows

This commit is contained in:
poetwang
2013-03-23 17:38:42 +08:00
committed by lins05
parent c8b1449c21
commit dda14cbd61

View File

@@ -331,6 +331,13 @@ else:
load_local_settings(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
try:
sys.path.insert(0, install_topdir)
@@ -340,11 +347,14 @@ except ImportError:
else:
# In server release, sqlite3 db file is <topdir>/seahub.db
DATABASES['default']['NAME'] = os.path.join(install_topdir, 'seahub.db')
# In server release, gunicorn is used to deploy seahub
INSTALLED_APPS += ('gunicorn', )
if 'win32' not in sys.platform:
# In server release, gunicorn is used to deploy seahub
INSTALLED_APPS += ('gunicorn', )
load_local_settings(seahub_settings)
del seahub_settings
# Remove install_topdir from path
sys.path.pop(0)