The API server for Okuna.
The project is a Django application.
There are many different ways to contribute to the website development, just find the one that best fits with your skills and open an issue/pull request in the repository.
Examples of contributions we love include:
- Code patches
- Bug reports
- Patch reviews
- Translations
- UI enhancements
Please read and follow our Code of Conduct.
Every contribution accepted is licensed under AGPL v3.0 or any later version. You must be careful to not include any code that can not be licensed under this license.
Please read carefully our license and ask us if you have any questions.
Cyber-hero? Check out our Vulnerability Disclosure page.
We're available almost 24/7 in the Okuna slack channel. Join us!
Help us keep the repository history consistent π!
We use gitmoji as our git message convention.
If you're using git in your command line, you can download the handy tool gitmoji-cli.
git clone git@github.com:OkunaOrg/okuna-api.git
cp .env.sample .env
nano .env
pipenv install
pipenv shell
python manage.py migrate
python manage.py collectmedia
python manage.py loaddata circles.json emoji-groups.json emojis.json badges.json categories.json languages.json
For local API development it suffices to bind the server to localhost:
python manage.py runserver
For app development you have to bind the server to your local network:
python manage.py runserver 0.0.0.0:8000
- Use
./manage.py makemessages -l es
to generate messages. Doesn't matter which language we target, the translation tool is agnostic. - This generates a new
django.po
file in thelocale/es/LC_MESSAGES/
folder. It will have all the source strings and a place to enter the translation strings. It doesnt overwrite previous translations. - Sometimes, if django is confused, it marks a string as fuzzy. So do search for the word 'fuzzy' in
django.po
- If you find a fuzzy string, you can resolve it manually. Finally each string should like this
#: openbook_lists/validators.py:10 <- place where the string occurs in code
msgid "The list does not exist." <- english translations
msgstr "Die Liste ist nicht vorhanden." <-- this will be empty for new strings
- Upload this
django.po
file to https://crowdin.com/project/okuna/settings#files by pressingUpdate
next to the existingdjango.po
file. - Once all language volunteers have translated the new strings, download all the
django.po
files for each locale and put them in their respective folders. - Run
./manage.py compilemessages
to auto-generatedjango.mo
files. - You need to checkin both
django.po
anddjango.mo
files for each locale.
Creates a user invite and outputs its token. Required for creating a new account.
usage: manage.py create_invite [-h] [--email EMAIL] [--username USERNAME] [--name NAME] [--badge BADGE]
Imports user invites from a kickstarter/indiegogo csv
usage: manage.py import_invites [-h] [--indiegogo PATH_TO_CSV] [--kickstarter PATH_TO_CSV]
Send invite emails to all user invites who have not been sent the email.
usage: manage.py send_invites [-h]
Assign user invites to all or specific users.
usage: manage.py allocate_invites [-h] [--count INCREMENT_INVITES_BY_COUNT] [--total TOTAL_INVITE_COUNT_TO_SET] [--username USERNAME]
Download the latest django.po files in the respective locale/ folders from crowdin.
Then locally run all or some of these commands depending on which models need updating.
It will update the .json
files, then check them in.
./manage.py shell < openbook_common/i18n/update_translations_emoji_groups.py
./manage.py shell < openbook_common/i18n/update_translations_emojis.py
./manage.py shell < openbook_moderation/i18n/update_translations.py
./manage.py shell < openbook_categories/i18n/update_translations.py
# Relational Database Service configuration
RDS_DB_NAME=okuna
RDS_USERNAME=root
RDS_PASSWORD=okuna
RDS_HOSTNAME=db.okuna
RDS_PORT=3306
RDS_HOSTNAME_READER=db.okuna
RDS_HOSTNAME_WRITER=db.okuna
usage: docker-compose build
usage: docker-compose up (-d in background)
You probably installed openssl via Homebew, make sure to follow the instructions that are given when you type brew info openssl
.
The local development server runs a separate process for the auto-reloader. You can turn off the auto-reload process by passing the --noreload flag.
python manage.py runserver --noreload