-
Notifications
You must be signed in to change notification settings - Fork 1
Home
Install and run Elasticsearch according to this article: https://linuxize.com/post/how-to-install-elasticsearch-on-ubuntu-18-04/
-
If you use Virtualenv, activate it:
$ source path/to/virtualenv/bin/activate
-
Run Django shell:
$ cd path/to/project/collaborative-platform/src/collaborative_platform/ $ python manage.py shell
-
Copy whole content from
.../apps/index_and_search/initialize.py
, paste it in Django shell andEnter
.
It's necessary only for test login to Collaborative Platform by Facebook on local machine. If you don't use this function (login by Google or ORCID will work), you can skip this point.
-
If you use Virtualenv, activate it:
$ source path/to/virtualenv/bin/activate
-
Install necessary packages:
$ pip install django-extensions Werkzeug pyOpenSSL service_identity
-
Add
django_extensions
toINSTALLED_APPS
insettings.py
:INSTALLED_APPS = [ ... 'django_extensions', ]
-
Instead default
runserver
command, start server with command:$ python manage.py runserver_plus --cert-file /tmp/cert
-
Now you can visit Collaborative Platform on https://localhost:8000/
To start executing periodic tasks, you need to run Celery Beat:
- In console go to
collaborative-platform/src/collaborative_platform/
directory - Run in console:
celery -A collaborative_platform worker -B -l DEBUG -E
All tests for each app should be in tests/
directory, inside main folder of the app, e.g. tests for:
close_reading
app should be in:
.../collaborative-platform/apps/close_reading/tests/
directory. Each category of tests should be in proper subdirectory, e.g. unit tests should be in
.../close_reading/tests/unit_tests/`
subdirectory.
All tests should be written with pytest
framework.
To run all tests, go to collaborative-platform/src/collaborative_platform/
directory and run:
pytest
Assumed three marks, to help run certain set tests:
unit_tests
integration_tests
functional_tests
To run tests marked with specific mark, e.g. unit_tests
run:
pytest -m unit_tests