Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Metagenomics
metagenedb
Commits
94f0faad
Commit
94f0faad
authored
Jun 18, 2019
by
Kenzo-Hugo Hillion
♻
Browse files
add script to start backend service and remove null from ManyToMany
parent
a4c12af3
Changes
6
Hide whitespace changes
Inline
Side-by-side
.gitignore
View file @
94f0faad
...
...
@@ -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/
...
...
backend/metagenedb/apps/catalog/migrations/0001_initial.py
View file @
94f0faad
# Generated by Django 2.2.1 on 2019-06-1
7 14:38
# Generated by Django 2.2.1 on 2019-06-1
8 09:45
from
django.db
import
migrations
,
models
import
django.db.models.deletion
...
...
backend/metagenedb/apps/catalog/models/gene.py
View file @
94f0faad
...
...
@@ -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
...
...
backend/metagenedb/settings/base.py
View file @
94f0faad
...
...
@@ -139,3 +139,4 @@ USE_TZ = True
# https://docs.djangoproject.com/en/2.2/howto/static-files/
STATIC_URL
=
'/static/'
STATIC_ROOT
=
'static'
backend/scripts/start.sh
0 → 100755
View file @
94f0faad
#!/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
docker-compose.yaml
View file @
94f0faad
...
...
@@ -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"
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment