Commit ce649c0d by Szabolcs Gelencser Committed by Szabolcs Gelencsér

Add windows support

parent d72aa9c8
...@@ -47,4 +47,6 @@ scripts.rc ...@@ -47,4 +47,6 @@ scripts.rc
circle/celery circle/celery
circle/circle/db.sqlite3 circle/circle/db.sqlite3
.idea .idea
\ No newline at end of file
venv
\ No newline at end of file
...@@ -113,7 +113,12 @@ try: ...@@ -113,7 +113,12 @@ try:
except: except:
systz = None systz = None
TIME_ZONE = get_env_variable('DJANGO_TIME_ZONE', default=systz) WINDOWS = get_env_variable('WINDOWS', False)
if WINDOWS:
TIME_ZONE = 'Europe/Budapest'
else:
TIME_ZONE = get_env_variable('DJANGO_TIME_ZONE', default=systz)
# See: https://docs.djangoproject.com/en/dev/ref/settings/#language-code # See: https://docs.djangoproject.com/en/dev/ref/settings/#language-code
LANGUAGE_CODE = get_env_variable("DJANGO_LANGUAGE_CODE", "en") LANGUAGE_CODE = get_env_variable("DJANGO_LANGUAGE_CODE", "en")
...@@ -439,23 +444,25 @@ LOGGING = { ...@@ -439,23 +444,25 @@ LOGGING = {
'filters': ['require_debug_false'], 'filters': ['require_debug_false'],
'class': 'django.utils.log.AdminEmailHandler' 'class': 'django.utils.log.AdminEmailHandler'
}, },
'syslog': {
'level': 'INFO',
'class': 'logging.handlers.SysLogHandler',
'formatter': 'simple',
'address': '/dev/log',
# 'socktype': SOCK_STREAM,
# 'address': ('host', '514'),
}
}, },
'loggers': { 'loggers': {
'django.request': { 'django.request': {
'handlers': ['mail_admins', 'syslog'], 'handlers': ['mail_admins',],
'level': 'INFO', 'level': 'INFO',
'propagate': True, 'propagate': True,
}, },
} }
} }
if WINDOWS:
LOGGING['handlers']['syslog'] = {
'level': 'INFO',
'class': 'logging.handlers.SysLogHandler',
'formatter': 'simple',
'address': '/dev/log',
# 'socktype': SOCK_STREAM,
# 'address': ('host', '514'),
}
LOGGING['loggers']['django.request']['handlers'] += 'syslog'
########## END LOGGING CONFIGURATION ########## END LOGGING CONFIGURATION
......
...@@ -17,7 +17,6 @@ ...@@ -17,7 +17,6 @@
import subprocess import subprocess
import os import os
import pyinotify
from django.core.management.base import BaseCommand from django.core.management.base import BaseCommand
from django.conf import settings from django.conf import settings
...@@ -39,7 +38,11 @@ class LessUtils(object): ...@@ -39,7 +38,11 @@ class LessUtils(object):
print("Compiling: %s" % os.path.basename(less_pathname)) print("Compiling: %s" % os.path.basename(less_pathname))
try: try:
subprocess.check_output(cmd) if settings.WINDOWS:
import sys
subprocess.Popen([sys.executable, cmd])
else:
subprocess.check_output(cmd)
except subprocess.CalledProcessError as e: except subprocess.CalledProcessError as e:
print(e.output) print(e.output)
else: else:
...@@ -69,6 +72,7 @@ class LessUtils(object): ...@@ -69,6 +72,7 @@ class LessUtils(object):
""" Watches for changes in LESS files recursively from the """ Watches for changes in LESS files recursively from the
project's root and compiles the files project's root and compiles the files
""" """
import pyinotify
wm = pyinotify.WatchManager() wm = pyinotify.WatchManager()
class EventHandler(pyinotify.ProcessEvent): class EventHandler(pyinotify.ProcessEvent):
...@@ -99,5 +103,6 @@ class Command(BaseCommand): ...@@ -99,5 +103,6 @@ class Command(BaseCommand):
print("\n%s\n" % ("=" * 30)) print("\n%s\n" % ("=" * 30))
print("End of initial LESS compiles\n") print("End of initial LESS compiles\n")
# after first run watch less files if not settings.WINDOWS:
LessUtils.start_watch() # after first run watch less files
LessUtils.start_watch()
...@@ -97,7 +97,6 @@ pyasn1==0.4.2 ...@@ -97,7 +97,6 @@ pyasn1==0.4.2
pycparser==2.18 pycparser==2.18
pycryptodomex==3.4.12 pycryptodomex==3.4.12
Pygments==2.0.2 Pygments==2.0.2
pyinotify==0.9.5
PyNaCl==1.2.1 PyNaCl==1.2.1
pyOpenSSL==17.5.0 pyOpenSSL==17.5.0
pyotp==2.1.1 pyotp==2.1.1
...@@ -131,7 +130,6 @@ subprocess32==3.2.7 ...@@ -131,7 +130,6 @@ subprocess32==3.2.7
traitlets==4.3.2 traitlets==4.3.2
unicodecsv==0.14.1 unicodecsv==0.14.1
urllib3==1.22 urllib3==1.22
uWSGI==2.0.13.1
warlock==1.3.0 warlock==1.3.0
wcwidth==0.1.7 wcwidth==0.1.7
WebOb==1.7.4 WebOb==1.7.4
......
-r circlestack.txt
pyinotify==0.9.5
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment