The profiles system for Knowledge Commons
License: MIT
This project is a work in progress and not complete.
This project provides API endpoints and HTML templated responses to retrieve detailed information about users in our system.
- Retrieves comprehensive user information including:
- Personal details (name, title, affiliation)
- Academic background and interests
- Publications and projects
- Social media handles and website URLs
- Commons activity and memberships
- And more...
Moved to settings.
There are a number of initial setup operations that need to be performed to get initial profile data into the system from the main WordPress application.
First, use the management command import_from_sql with the -file option to import a MySQL dump of the main HCommons/KCommons WordPress database:
$ python manage.py import_from_sql -file /path/to/hcommons.sql
alternatively, you can provide an S3 URL:
$ python manage.py import_from_sql -file s3://bucket/path/to/hcommons.sql
Second, you need to import the cover images. These are found inside the "knowledge-commons-wordpress/site/web/app/uploads/buddypress/members" directory. You need a minimum structure, on disk, of "buddypress/members" for this to work. The command is:
$ python manage.py import_cover_images /path/to/buddypress/
Third, you need to import profile images. These are found inside the "knowledge-commons-wordpress/site/web/app/uploads/avatars" directory. You need a minimum structure, on disk, of "uploads/avatars" for this to work. The command is:
$ python manage.py import_profile_images /path/to/uploads
-
To create a superuser account, use this command:
$ python manage.py createsuperuser
Running type checks with mypy:
$ mypy knowledge_commons_profiles
To run the tests, check your test coverage, and generate an HTML coverage report:
$ coverage run -m pytest
$ coverage html
$ open htmlcov/index.html
$ pytest
Moved to Live reloading and SASS compilation.
Sentry is an error logging aggregator service. You can sign up for a free account at https://sentry.io/signup/?code=cookiecutter or download and host it yourself. The system is set up with reasonable defaults, including 404 logging and integration with the WSGI application.
You must set the DSN url in production.
The following details how to deploy this application.
See detailed cookiecutter-django Docker documentation.
Contributions are welcome! Please feel free to submit a Pull Request.