If you are interested in taking a look at the current development snapshot, without wishing to develop code, see the instructions here. Please note, this is an early (alpha) snapshot of the code, and is not recommended for use for production purposes.
Clone the project from GitHub,
install the dependencies, make an inital database migration
and start the Django development server for the REST API.
ccp4i2-django is an overlay on vanilla ccp4i2, but requires some python dependencies of CCP4 to be updated.
For development, therefore, the currently supported mechanism
is to install a dedicated instance of ccp4 in which those dependencies can be updated without risk to the developer's main CCP4 installation.
user:$$ # After installing or activating your dedicated CCP4 instance and
user:~$ git clone https://github.com/paulsbond/ccp4i2-django
user:~$ cd ccp4i2-django/server
user:~/ccp4i2-django/server$ ccp4-python -m pip install -r requirements.txt
user:~/ccp4i2-django/server$ ccp4-python manage.py migrate
user:~/ccp4i2-django/server$ ccp4-python manage.py runserverThere should now be a browsable API available from the django test server with autogenerated forms provided by djangorestframework at http://localhost:8000.
Use ctrl-C to kill the dev server
The ccp4i2 test suite can be used to provide substrate for development To recover and import the test suite, navigate to the directory in which you have installed ccp4i2-django:
user:~/ccp4i2-django/server$ #Starting from the directory where you ended up above
user:~/ccp4i2-django/server$ cd ../..
user:~$ git clone git@gitlab.com:ccp4i2/test101.git
user:~$ cd ccp4i2-django/server
user:~$ ccp4-python manage.py import_ccp4_project_zip ../../test101/ProjectZips/*.ccp4_project.zipccp4i2-django is an electron app with source files in the client directory. To build and launch it in development mode, sinply:
user:~$ cd ccp4i2-django/client
user:~/ccp4i2-django/client$ npm ci
user:~/ccp4i2-django/client$ npm run startThe django instance and the UI will update automatically when any changes are made to source code files.
See here for guidance on how to get started with ccp4i2-django
See here for guidance on how to create a task interface
First rule of ccp4i2-django development is don't change the data model without consultation. Data model changes are actually straightforward (thanks to django), but need to be introduced in a consistent manner.
If you ar ehappy ignoring the first rule, then run the following commands to update the database then restart the server:
user:~/ccp4i2-django$ ccp4-python manage.py makemigrations
user:~/ccp4i2-django$ ccp4-python manage.py migrateSee here for guidance on how to build and deploy through electron or as web app