Commit 89fc742b authored by Nathalie Rousse's avatar Nathalie Rousse
Browse files

Correction to be able to initialize database

parent dac1fa3c
......@@ -109,12 +109,15 @@ def get_vlepkgname_choices() :
"""
choices_list = [ empty_choice ]
for vlerep in VleRep.objects.all() :
vlepkgname_list = get_rep_pkgname_list(rep_path=vlerep.path,
vle_version=vlerep.get_vle_version_name())
for vlepkgname in vlepkgname_list :
choice_info = "rep: "+vlerep.name+" ; pkg: "+vlepkgname
choices_list.append( (vlepkgname, choice_info) )
try :
for vlerep in VleRep.objects.all() :
vlepkgname_list = get_rep_pkgname_list(rep_path=vlerep.path,
vle_version=vlerep.get_vle_version_name())
for vlepkgname in vlepkgname_list :
choice_info = "rep: "+vlerep.name+" ; pkg: "+vlepkgname
choices_list.append( (vlepkgname, choice_info) )
except :
pass
return choices_list
ht_vlepkg_name = mht_vlepkg_name+ \
......@@ -138,17 +141,20 @@ def get_vlevpzname_choices() :
"""
choices_list = [ empty_choice ]
for vlepkg in VlePkg.objects.all() :
vlepkg_exp_path = get_rep_pkg_exp_path(rep_path=vlepkg.vlerep.path,
vle_version=vlepkg.vlerep.get_vle_version_name(),
pkgname=vlepkg.name)
tmp = forms.FilePathField( path=vlepkg_exp_path, recursive=True,
allow_files=True, allow_folders=False, match=".*\.vpz$")
for (v,c) in tmp.choices :
vlevpzname = os.path.relpath( v, vlepkg_exp_path )
choice_info = "rep: "+vlepkg.vlerep.name+" ; pkg: "+ \
vlepkg.name+" ; vpz: "+vlevpzname
choices_list.append( (vlevpzname, choice_info) )
try :
for vlepkg in VlePkg.objects.all() :
vlepkg_exp_path = get_rep_pkg_exp_path(rep_path=vlepkg.vlerep.path,
vle_version=vlepkg.vlerep.get_vle_version_name(),
pkgname=vlepkg.name)
tmp = forms.FilePathField( path=vlepkg_exp_path, recursive=True,
allow_files=True, allow_folders=False, match=".*\.vpz$")
for (v,c) in tmp.choices :
vlevpzname = os.path.relpath( v, vlepkg_exp_path )
choice_info = "rep: "+vlepkg.vlerep.name+" ; pkg: "+ \
vlepkg.name+" ; vpz: "+vlevpzname
choices_list.append( (vlevpzname, choice_info) )
except :
pass
return choices_list
ht_vlevpz_name = mht_vlevpz_name+ \
......
......@@ -82,11 +82,11 @@ erecord software configuration
cd /opt/erecord/docs/source/devel/design/webapi/include ;
sed -i 's/erecord.toulouse.inra.fr/127.0.0.1/g' online_url*.rst ; )
====================
erecord static files
====================
====================================================
erecord static files generation (creation, updating)
====================================================
Static files creation (css, js, images) :
Static files (css, js, images) :
# if not yet done, activate erecordenv virtualenv :
source /opt/erecord/factory/install/erecordenv/bin/activate
......@@ -94,6 +94,29 @@ Static files creation (css, js, images) :
cd /opt/erecord/erecord/projects/ws
python manage.py collectstatic
========================================
erecord database creation (and updating)
========================================
Database /opt/erecord/databases/erecord_default.sqlite3 :
# if not yet done, activate erecordenv virtualenv :
source /opt/erecord/factory/install/erecordenv/bin/activate
# or source /opt/erecord/factory/install/erecordenv/bin/activate.csh
cd /opt/erecord/erecord/projects/ws
- create/update database :
python manage.py makemigrations erecord_db
python manage.py makemigrations erecord_acs
python manage.py makemigrations erecord_vpz
python manage.py makemigrations erecord_slm
python manage.py migrate
- create admin user into database :
python manage.py createsuperuser
... => admin user (erecordadmin)
==========================
erecord main documentation
==========================
......@@ -115,36 +138,14 @@ erecord main documentation
Run
===
django INIT
-----------
# if not yet done, activate erecordenv virtualenv :
source /opt/erecord/factory/install/erecordenv/bin/activate
# or source /opt/erecord/factory/install/erecordenv/bin/activate.csh
cd /opt/erecord/erecord/projects/ws
python manage.py makemigrations erecord_db
python manage.py makemigrations erecord_acs
python manage.py makemigrations erecord_vpz
python manage.py makemigrations erecord_slm
python manage.py migrate
python manage.py createsuperuser
=> admin (erecordadmin)
python manage.py collectstatic
python manage.py runserver
django run
----------
# if not yet done, activate erecordenv virtualenv :
source /opt/erecord/factory/install/erecordenv/bin/activate
# or source /opt/erecord/factory/install/erecordenv/bin/activate.csh
cd /opt/erecord/erecord/projects/ws
python manage.py migrate
# (+ see static files updating and database updating)
python manage.py runserver
=====
Notes
=====
......
......@@ -125,6 +125,28 @@ Static files creation (css, js, images) :
cd /opt/erecord/erecord/projects/ws
python manage.py collectstatic
=========================
erecord database creation
=========================
Creation of the database (/opt/erecord/databases/erecord_default.sqlite3) :
- Activate erecordenv virtualenv (if not yet done) :
source /opt/erecord/factory/install/erecordenv/bin/activate
or source /opt/erecord/factory/install/erecordenv/bin/activate.csh
cd /opt/erecord/erecord/projects/ws
- create database :
python manage.py makemigrations erecord_db
python manage.py makemigrations erecord_acs
python manage.py makemigrations erecord_vpz
python manage.py makemigrations erecord_slm
python manage.py migrate
- create admin user into database :
python manage.py createsuperuser
==========================
erecord main documentation
==========================
......
Markdown is supported
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