Collections is a prototype project at the Center for Open Science. This project is experimental, scope, technologies, code and functionality may change. This app has two main parts. The service stores data about the collection, and the client lets users interact with their collections.
You will need the following things properly installed on your computer.
$ git clone [email protected]:cos-labs/collections-service.git
$ cd collections-service
Setting up a virtual environment for Python 3 is recommended.
$ pyenv virtualenv 3.6.0 osf-collections
$ pip install -r requirements.txt
Using a package manager like brew is recommended.
$ brew services postgres start
$ cd {collections}/
$ ./manage.py makemigrations
$ ./manage.py migrate
$ python manage.py runserver
Visit the api at http://localhost:8000/api/
or admin panel at http://localhost:8000/admin/
.
Follow the set-up instructions in the README for https://github.com/cos-labs/collections.
Visit your app at http://localhost:4200.
Set up the backend to use either staging or prod. Do this in the sessions for both the client and the service. export BACKEND=prod
or export BACKEND=stage
Create a developer app at https://staging.osf.io/settings/applications/ with the following settings:
- Project homepage URL: http://localhost:8000/
- Callback URL: http://localhost:8000/accounts/osf/login/callback/
$ python manage.py createsuperuser
Create a new Site with domain name: http://localhost:8000/ in the django admin panel:
- Note: The site id must match the
SITE_ID
variable defined inSITE_ID
should be set to the site id incollections-service/service/settings/local.py
- The SITE_ID can be found in the URL
- You may have to define SITE_ID in the local.py file
- Set provider to "Open Science Framework"
- Set the client id and secret key to the ones defined in your developer app
- Select http://localhost:8000/ as the site
python manage.py rebuild_index
- This needs to be done on first run / population and then on a semi-regular basis when running the API to index new content from the API.
- Before moving forward, make sure you've logged into the test server using your OSF staging credentials.
- To populate the database with users, meetings, collections, and items, run
$ python populate.py
from the project root.
python manage.py test