Create virtualenv using python3 (follow https://virtualenvwrapper.readthedocs.io/en/latest/install.html)
mkvirtualenv coobs
Activate the virtualenv
workon coobs
Install python requirements
make install-requirements
Copy the settings template
cp coobs/settings/dev.template.py coobs/settings/dev.py
Generate new Django secret key and update SECRET_KEY
value at coobs/settings/dev.py
sed -i "s!SECRET_KEY = .*!SECRET_KEY = '$(openssl rand -base64 32)'!g" coobs/settings/dev.py
Setup postgres user for coobs
database
sudo -iu postgres bash -c "psql -c \"CREATE USER coobs WITH PASSWORD 'coobspass';\""
sudo -iu postgres bash -c "psql -c \"ALTER ROLE coobs SET client_encoding TO 'utf8';\""
sudo -iu postgres bash -c "psql -c \"ALTER ROLE coobs SET default_transaction_isolation TO 'read committed';\""
sudo -iu postgres bash -c "psql -c \"ALTER ROLE coobs SET timezone TO 'UTC';\""
Configure database parameters at coobs/settings/dev.py
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'coobs',
'USER': 'coobs',
'PASSWORD': 'coobspass',
'HOST': 'localhost',
'PORT': '5432'
},
}
Create the coobs
database, run migrations and create Django superuser
make reset-db
Run the server
make server
API now should be accessible at:
http://localhost:8000/api/
Install node dependencies:
make install-frontend
Start the frontend app:
make frontend
App core, landing and help pages should be accesible at:
http://localhost:8080/app/
http://localhost:8080/landing/
http://localhost:8080/help/
Go to /coobs/frontend/locales
and add the new language in langs.json
file
key -> language short ISO code
value -> language name
In the same folder add a new file with ISO code as name and .json
extension
Add all existing translations for the new language.
Try to find if translation does not already exist.
Add new pair key/value in each translations file.
Add new locale file
python manage.py makemessages -l <ISO_language_code>
(i.e.) python manage.py makemessages -l es
Define model name associated to translations
class Meta:
verbose_name = _('class_name')
Define field name associated to translations
option -> verbose_name=_('field_name')
Common fields (Boolean, Char, Text, etc) can have this verbose name as the first parameter without include the verbose_name attribute name. The attribute name is a must for relations (ManyToMany, ForeignKeys, etc).
Add keys to all .po files
python manage.py makemessages
Translate each key for all existing languages
Compile new translations
python manage.py compilemessages
To create a release just follow this steps:
Merge master
into production
git checkout master
git pull
git checkout production
git pull
git merge --no-ff master
git push origin production
git checkout master
Generate a new release here and make sure to select the production branch!
Write a brief release description and use a senver string for tag and title like: vX.Y.Z
Just run make test
and there you go!