Skip to content
Snippets Groups Projects
Commit 94f0faad authored by Kenzo-Hugo Hillion's avatar Kenzo-Hugo Hillion :recycle:
Browse files

add script to start backend service and remove null from ManyToMany

parent a4c12af3
No related branches found
No related tags found
No related merge requests found
...@@ -3,8 +3,11 @@ __pycache__/ ...@@ -3,8 +3,11 @@ __pycache__/
.env .env
.idea/ .idea/
# For settings configuration # Backend
## For settings
backend/metagenedb/settings/__init__.py backend/metagenedb/settings/__init__.py
## Static files
backend/static
# Jupyter notebook # Jupyter notebook
notebooks/ 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 from django.db import migrations, models
import django.db.models.deletion import django.db.models.deletion
......
...@@ -6,7 +6,7 @@ from .function import Function ...@@ -6,7 +6,7 @@ from .function import Function
class Gene(models.Model): class Gene(models.Model):
gene_id = models.CharField(max_length=100, unique=True, db_index=True) gene_id = models.CharField(max_length=100, unique=True, db_index=True)
gene_length = models.IntegerField() gene_length = models.IntegerField()
functions = models.ManyToManyField(Function, null=True) functions = models.ManyToManyField(Function)
def __str__(self): def __str__(self):
return self.gene_id return self.gene_id
......
...@@ -139,3 +139,4 @@ USE_TZ = True ...@@ -139,3 +139,4 @@ USE_TZ = True
# https://docs.djangoproject.com/en/2.2/howto/static-files/ # https://docs.djangoproject.com/en/2.2/howto/static-files/
STATIC_URL = '/static/' 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' ...@@ -2,6 +2,7 @@ version: '3.7'
services: services:
backend: backend:
container_name: backend
build: ./backend build: ./backend
volumes: volumes:
- ./backend:/code - ./backend:/code
...@@ -12,9 +13,10 @@ services: ...@@ -12,9 +13,10 @@ services:
DEBUG: "true" DEBUG: "true"
depends_on: depends_on:
- db - db
command: python /code/scripts/manage.py runserver 0.0.0.0:8000 command: /code/scripts/start.sh
db: db:
container_name: db
image: postgres:latest image: postgres:latest
ports: ports:
- "5433:5432" - "5433:5432"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment