Commit 56da96f7 authored by Benoit Alessandroni's avatar Benoit Alessandroni

Fixing some references and adding stuff in README

parent 253e788b
# Django LDP example
# Django LDP Like
## Step by step quickstart
## Context
1. Installation
- `git clone git@git.happy-dev.fr:startinblox/djangoldp-packages/djangoldp-example.git /path/to/myawesomepackage`
- `git remote set-url origin the_repository_url`
- rename djangoldp_example directory to djangoldp_myawesomepackage
The goal of this repository is to make available to all of our models a Like feature, covering the like action, dislike action, and count of both use cases.
NB:
- replace /path/to/myawesomepackage with the local path of your package.
- replace the_repository_url with the git url of your package (example: git@git.happy-dev.fr:startinblox/djangoldp-packages/djangoldp-example.git).
- replace djangoldp_myawesomepackage with your package name. Please respect the naming convention (singular word, starting by `djangoldp_`)
The like Model will be related to an IDURLField targetting users/ so that we will be able to relate the users and their likes in a distributed world.
2. Developpement environnement
In order to test and developp your package, you need to put the package src directory at the same level of a working django ldp app. By exemple, you can clone the sib app data server
`git clone git@git.happy-dev.fr:startinblox/applications/sib-app-data-server.git server /path/to/app`
- The classical way :
`ln -s /path/to/myawesomepackage/djangoldp_myawesomepackage /path/to/app/djangoldp_myawesomepackage`
- The docker way : in the *volumes* section, add a line in docker-compose.override.yml. Example
```
volumes:
- ./:/app
- /path/to/myawesomepackage/djangoldp_myawesomepackage:/app/djangoldp_myawesomepackage
```
Would ideally be implemented in a way which makes it compatible with the [ActivityPub Like Activity](https://www.w3.org/TR/activitypub/#like-activity-outbox)
Add your package in settings.py of the app. Now, you can test if your package is imported propefully by doing a
`python manage.py shell` then
......@@ -33,16 +14,20 @@ from djangoldp_myawesomepackage.models import ExampleModel
If, no error, it's working.
3. Customization
- `setup.cfg` : please, fill the name, version, url, author_email, description
- `djangoldp_example/__init__.py`: fill the name, don't touch the version number !
- everything under the djangoldp_example is part of your package, you probably would replace "example" by your package name.
## Planning
1. Make it work:
Being able to post a like, a dislike.
Being able to retrieve the count of likes and dislikes for a given resource
Being able to do that on the federation instance bearing the current user identity
4. Push on the repository you've created
2. Make it clean
## Notes
Test it in the context of the federation
Ensure we stay compliant with the activityPub specification
### CICD
## CICD
When you're ready to publish your app :
1. Add the `sib-deploy` user as a `maintainer` to the project (`Settings > Members`)
......
from django.core.management.base import BaseCommand, CommandError
from djangoldp_example.factories import ExampleFactory
from djangoldp_like.factories import ExampleFactory
class Command(BaseCommand):
help = 'Mock data'
......
[metadata]
name = djangoldp_example
version = attr: djangoldp_example.__version__
url = http://git.happy-dev.fr/startinblox/djangoldp_example
name = djangoldp_like
version = attr: djangoldp_like.__version__
url = http://git.happy-dev.fr/startinblox/djangoldp-packages/djangoldp-like
author = Startin'blox
author_email = nicolas@happy-dev.fr
description = djangoldp example package
author_email = benoit@paris.happy-dev.fr
description = DjangoLDP Like package
license = MIT
[options]
......@@ -18,5 +18,5 @@ dev =
[semantic_release]
version_source = tag
version_variable = djangoldp_example/__init__.py:__version__
version_variable = djangoldp_like/__init__.py:__version__
commit_parser = commit_parser.parse
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment