From: Guillaume Pellerin Date: Wed, 18 Mar 2015 21:50:23 +0000 (+0100) Subject: better doc for sqlite and mysql X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=900eb4a296cecfeeab6b8c3a4af2f749341fc824;p=timeside.git better doc for sqlite and mysql --- diff --git a/docker-compose-mysql.yml b/docker-compose-mysql.yml index 4e01fdd..9f11f79 100644 --- a/docker-compose-mysql.yml +++ b/docker-compose-mysql.yml @@ -68,6 +68,15 @@ rabbitmq: expose: - "5672" +worker: + build: . + volumes_from: + - home + command: /bin/sh /opt/TimeSide/examples/deploy/celery_app.sh + links: + - rabbitmq + - db + app: build: . volumes: @@ -84,15 +93,7 @@ app: links: - rabbitmq - db - -worker: - build: . - volumes_from: - - home - command: /bin/sh /opt/TimeSide/examples/deploy/celery_app.sh - links: - - rabbitmq - - db + - worker nginx: image: nginx diff --git a/examples/sandbox/settings.py b/examples/sandbox/settings.py index f08af19..e3f784c 100644 --- a/examples/sandbox/settings.py +++ b/examples/sandbox/settings.py @@ -16,16 +16,20 @@ PROJECT_ROOT = os.path.dirname(os.path.abspath(__file__)) DATABASES = { 'default': { - 'ENGINE': 'django.db.backends.mysql', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'. + # SQLite config + # 'ENGINE': 'django.db.backends.sqlite', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'. # 'NAME': os.path.join(PROJECT_ROOT, 'timeside.sql'), # Or path to database file if using sqlite3. - 'NAME': 'timeside', # Or path to database file if using sqlite3. + # 'OPTIONS': { + # 'timeout': 60, + # } + + # MySQL config + 'ENGINE': 'django.db.backends.mysql', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'. 'USER': 'root', # Not used with sqlite3. 'PASSWORD': 'mysecretpassword', # Not used with sqlite3. + 'NAME': 'timeside', 'HOST': 'db', # Set to empty string for localhost. Not used with sqlite3. 'PORT': '3306', # Set to empty string for default. Not used with sqlite3. - # 'OPTIONS': { - # 'timeout': 60, - # } } } @@ -175,10 +179,10 @@ LOGGING = { REST_FRAMEWORK = { } -# One or more gearman servers -# GEARMAN_SERVERS = ['127.0.0.1'] +# replace rabbitmq by localhost if you start your app outside docker-compose BROKER_URL = 'amqp://guest:guest@rabbitmq//' + CELERY_IMPORTS = ("timeside.server.tasks",) CELERY_RESULT_BACKEND='djcelery.backends.database:DatabaseBackend' CELERY_TASK_SERIALIZER = "json"