diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 3ce4047..9cc0465 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -2,10 +2,62 @@ ## Project structure - +``` +platform +├── free_our_knowledge +│ ├── __init__.py +│ ├── settings +│ ├── resources +│ ├── urls.py +│ └── wsgi.py +├── docker +│ └── Dockerfile +│ └── docker-compose.yml +│ └── entrypoint.sh +├── manage.py +└── requirements.txt +``` ## Getting Started + +### Development installation + +1. CLone the repository locally: + +``` +git clone git@github.com:FreeOurKnowledge/platform.git +``` + +2. Create a new virtual environment and activate it: + +``` +python3 -m venv fok_env +source fok_env/bin/activate +``` + +3. Install all of the dependencies: + +``` +pip install -r requirements.txt +``` + +4. Generate the database tables: + +``` +python manage.py migrate --noinput +``` + +4. Start the project: + +```python + python manage.py runserver +``` + +If everything works the platform should be available on http://127.0.0.1:8000/. + +### Docker installation + 1. Build the development image. From the project root: sudo docker build . -f ./docker/Dockerfile -t fok_platform @@ -19,3 +71,5 @@ 3. [Configure credentials]?? 4. Open a browser to http://localhost:8080/ to view the application (if using Chromebook, go to http://penguin.termina.linux.test:8080/) + + diff --git a/apps/fok/models.py b/apps/fok/models.py index ff0e677..3c82d24 100644 --- a/apps/fok/models.py +++ b/apps/fok/models.py @@ -125,8 +125,8 @@ class Meta: user = models.ForeignKey(get_user_model(), on_delete=models.SET_NULL, null=True, related_name='pledges') campaign = models.ForeignKey(Campaign, on_delete=models.SET_NULL, null=True, related_name='pledges') - implication = models.FloatField(verbose_name='Threshold') - author_position = models.ManyToManyField(EnabledAuthorPosition) + implication = models.FloatField(verbose_name='Threshold', blank=True, default=None) + author_position = models.ManyToManyField(EnabledAuthorPosition, blank=True, default=None) allow_public_name = models.BooleanField(default=False) created_at = models.DateTimeField(auto_now_add=True) updated_at = models.DateTimeField(auto_now=True)