installation
This commit is contained in:
Executable
+32
@@ -0,0 +1,32 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
# Script d'installation de l'application'
|
||||||
|
|
||||||
|
# Mise à jour des paquets
|
||||||
|
echo "installation de l'application django ..."
|
||||||
|
echo
|
||||||
|
|
||||||
|
ETC="$(pwd)"
|
||||||
|
APP_DIR=" ../test_tube_scanner"
|
||||||
|
|
||||||
|
cd $APP_DIR
|
||||||
|
|
||||||
|
echo "migration de la base de données ..."
|
||||||
|
./manage.py migrate
|
||||||
|
./manage.py makemigrations
|
||||||
|
./manage.py migrate
|
||||||
|
|
||||||
|
echo "User / django_celery_beat ..."
|
||||||
|
./manage.py init_data
|
||||||
|
|
||||||
|
echo "Tables ..."
|
||||||
|
./manage.py loaddata $ETC/db/configuration.json
|
||||||
|
./manage.py loaddata $ETC/db/well.json
|
||||||
|
./manage.py loaddata $ETC/db/multiwell.json
|
||||||
|
./manage.py loaddata $ETC/db/welposition.json
|
||||||
|
|
||||||
|
|
||||||
|
echo
|
||||||
|
echo "=== Installation terminée ==="
|
||||||
|
echo
|
||||||
|
|
||||||
|
|
||||||
@@ -58,11 +58,11 @@ REDIS_PORT=6379
|
|||||||
# database: sqlite3 | mariadb | postgrey
|
# database: sqlite3 | mariadb | postgrey
|
||||||
#
|
#
|
||||||
# sqlite3
|
# sqlite3
|
||||||
SQLITE3=default
|
SQLITE3=None
|
||||||
SQLITE3_PATH=
|
SQLITE3_PATH=
|
||||||
|
|
||||||
# mariadb
|
# mariadb
|
||||||
MARIADB=None
|
MARIADB=default
|
||||||
DATABASE_MARIADB_HOST=127.0.0.1
|
DATABASE_MARIADB_HOST=127.0.0.1
|
||||||
DATABASE_MARIADB_PORT=3306
|
DATABASE_MARIADB_PORT=3306
|
||||||
|
|
||||||
|
|||||||
@@ -6,22 +6,6 @@ from django.conf import settings
|
|||||||
from django.core.management import BaseCommand
|
from django.core.management import BaseCommand
|
||||||
from django_celery_beat.models import IntervalSchedule, CrontabSchedule, SolarSchedule
|
from django_celery_beat.models import IntervalSchedule, CrontabSchedule, SolarSchedule
|
||||||
from django.contrib.auth import get_user_model
|
from django.contrib.auth import get_user_model
|
||||||
from scanner.models import Well
|
|
||||||
|
|
||||||
def create_Well():
|
|
||||||
try:
|
|
||||||
if Well.objects.count() == 0:
|
|
||||||
for name in [
|
|
||||||
'A1', 'A2', 'A3', 'A4', 'A5', 'A6',
|
|
||||||
'B1', 'B2', 'B3', 'B4', 'B5', 'B6',
|
|
||||||
'C1', 'C2', 'C3', 'C4', 'C5', 'C6',
|
|
||||||
'D1', 'D2', 'D3', 'D4', 'D5', 'D6',
|
|
||||||
]:
|
|
||||||
Well.objects.create(name=name, user_id=1)
|
|
||||||
print('Creating Well')
|
|
||||||
except Exception as e:
|
|
||||||
print(f'Creating well error {e}')
|
|
||||||
|
|
||||||
|
|
||||||
def create_user():
|
def create_user():
|
||||||
try:
|
try:
|
||||||
@@ -84,7 +68,6 @@ class Command(BaseCommand):
|
|||||||
try:
|
try:
|
||||||
create_user()
|
create_user()
|
||||||
create_schedule()
|
create_schedule()
|
||||||
create_Well()
|
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(f'Creating monitor error {e}')
|
print(f'Creating monitor error {e}')
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ import threading
|
|||||||
import logging
|
import logging
|
||||||
from datetime import datetime, timezone
|
from datetime import datetime, timezone
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import Optional, Callable, TYPE_CHECKING, Any
|
from typing import Optional, Callable, TYPE_CHECKING
|
||||||
|
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from modules.planarian_tracker import PlanarianTracker
|
from modules.planarian_tracker import PlanarianTracker
|
||||||
|
|||||||
@@ -44,6 +44,7 @@ class Configuration(models.Model):
|
|||||||
# Grbl configuration
|
# Grbl configuration
|
||||||
grbl_xmax = models.FloatField(_("Grbl Xmax"), help_text=_("CNC Grbl Xmax en mm"), blank=False, default=350.0)
|
grbl_xmax = models.FloatField(_("Grbl Xmax"), help_text=_("CNC Grbl Xmax en mm"), blank=False, default=350.0)
|
||||||
grbl_ymax = models.FloatField(_("Grbl Ymax"), help_text=_("CNC Grbl Ymax en mm"), blank=False, default=250.0)
|
grbl_ymax = models.FloatField(_("Grbl Ymax"), help_text=_("CNC Grbl Ymax en mm"), blank=False, default=250.0)
|
||||||
|
|
||||||
|
|
||||||
# camera configuration
|
# camera configuration
|
||||||
use_rpicam = models.BooleanField(_("Utiliser rpicam"), help_text=_("Par défaaut. Sinon USB webcam"), default=True)
|
use_rpicam = models.BooleanField(_("Utiliser rpicam"), help_text=_("Par défaaut. Sinon USB webcam"), default=True)
|
||||||
|
|||||||
Reference in New Issue
Block a user