Skip to content

MESH-Research/knowledge-commons-profiles

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

knowledge-commons-profiles

The profiles system for Knowledge Commons

Built with Cookiecutter Django Ruff Python Code style: djlint Django License Version PRs Welcome Last Commit coverage

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.

Features

  • 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...

Settings

Moved to settings.

Initial Setup

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

Basic Commands

Setting Up Your Users

  • To create a superuser account, use this command:

    $ python manage.py createsuperuser
    

Type checks

Running type checks with mypy:

$ mypy knowledge_commons_profiles

Test coverage

To run the tests, check your test coverage, and generate an HTML coverage report:

$ coverage run -m pytest
$ coverage html
$ open htmlcov/index.html

Running tests with pytest

$ pytest

Live reloading and Sass CSS compilation

Moved to Live reloading and SASS compilation.

Sentry

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.

Deployment

The following details how to deploy this application.

Docker

See detailed cookiecutter-django Docker documentation.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

About

New profiles API

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •