Commit 94f0faad authored by Kenzo-Hugo Hillion's avatar Kenzo-Hugo Hillion
Browse files

add script to start backend service and remove null from ManyToMany

parent a4c12af3
......@@ -3,8 +3,11 @@ __pycache__/
.env
.idea/
# For settings configuration
# Backend
## For settings
backend/metagenedb/settings/__init__.py
## Static files
backend/static
# Jupyter notebook
notebooks/
......
# Generated by Django 2.2.1 on 2019-06-17 14:38
# Generated by Django 2.2.1 on 2019-06-18 09:45
from django.db import migrations, models
import django.db.models.deletion
......
......@@ -6,7 +6,7 @@ from .function import Function
class Gene(models.Model):
gene_id = models.CharField(max_length=100, unique=True, db_index=True)
gene_length = models.IntegerField()
functions = models.ManyToManyField(Function, null=True)
functions = models.ManyToManyField(Function)
def __str__(self):
return self.gene_id
......
......@@ -139,3 +139,4 @@ USE_TZ = True
# https://docs.djangoproject.com/en/2.2/howto/static-files/
STATIC_URL = '/static/'
STATIC_ROOT = 'static'
#!/bin/bash
SCRIPTS_PATH=scripts
python ${SCRIPTS_PATH}/manage.py collectstatic --no-input
# python ${SCRIPTS_PATH}/manage.py makemigrations
python ${SCRIPTS_PATH}/manage.py migrate
python ${SCRIPTS_PATH}/manage.py runserver 0.0.0.0:8000
......@@ -2,6 +2,7 @@ version: '3.7'
services:
backend:
container_name: backend
build: ./backend
volumes:
- ./backend:/code
......@@ -12,9 +13,10 @@ services:
DEBUG: "true"
depends_on:
- db
command: python /code/scripts/manage.py runserver 0.0.0.0:8000
command: /code/scripts/start.sh
db:
container_name: db
image: postgres:latest
ports:
- "5433:5432"
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment