openrave.org uses Django for managing documentation, news, and blogs. The code is maintained at:
https://github.com/rdiankov/openrave.org
Using system similar to djangoproject.com
- Create a virtualenv
- Install dependencies:
apt-get install postgresql postgresql-client libpq-dev memcached python-dev gettext pip install -r deploy-requirements.txtIf you only need to deploy, and don't need to test any changes, you can use local-requirements.txt
Dependencies for Apache Webserver Deployment:
apt-get install libapache2-mod-wsgi a2enmod wsgi
Set up databases, as per django_website/settings/www.py
Create a 'openrave.org_secrets.json' file in the directoy above the checkout, containing something like:
{ "secret_key": "xyz", "superfeedr_creds": ["any@email.com", "some_string"] }
Initial DB Setup:
./manage.py syncdb ./manage.py convert_to_south docs
Future DB Update:
./manage.py syncdb ./manage.py migrate
For Docs:
./manage.py loaddata doc_releases.json ./manage.py update_docs
For adding new document:
export OPENRAVE_VERSION=0.8.0 export DOC_LANG=en DJANGO_SETTINGS_MODULE=openrave_website.settings python -c "from openrave_website.docs import models; models.DocumentRelease.objects.create(lang='$DOC_LANG',version='$OPENRAVE_VERSION', scm=models.DocumentRelease.GIT, scm_url='https://github.com/rdiankov/openrave/tree/v$OPENRAVE_VERSION', is_default=False);"Re-index the documents:
./manage.py update_docsMini script to convert latest_stable docdata to a specific version:
export OPENRAVE_VERSION=0.8.0 unzip openravejson-latest_stable.zip mv openravejson-latest_stable openravejson-$OPENRAVE_VERSION zip -r openravejson-$OPENRAVE_VERSION.zip openravejson-$OPENRAVE_VERSION unzip openravehtml-latest_stable.zip mv openravehtml-latest_stable openravehtml-$OPENRAVE_VERSION zip -r openravehtml-$OPENRAVE_VERSION.zip openravehtml-$OPENRAVE_VERSION
Internationalization. For Japanese, edit locale/ja_JP/LC_MESSAGES/django.po file:
django-admin.py makemessages --locale=ja_JP django-admin.py compilemessages --locale=ja_JP
Running Locally:
python manage.py runserver
For deployment checkout fabfile.py:
https://openrave.svn.sourceforge.net/svnroot/openrave/openrave.org/fabfile.py
sudo -u postgres psql --command "CREATE ROLE openrave PASSWORD 'testpass' SUPERUSER CREATEDB CREATEROLE INHERIT LOGIN;"
createdb --host localhost --username openrave --encoding UTF-8 openrave_website
All HTML templates are in openrave_website/templates. Tutorial on HTML + Django syntax template language
Only write English in the HTML files and only inside these translation blocks:
Videos and image filenames should also be written within the translation blocks so that we can substitute them with the language equivalent.
When English templates are done, execute:
django-admin.py makemessages --locale=ja_JP
Open locale/ja_JP/LC_MESSAGES/django.po and edit the translations. When done execute:
django-admin.py compilemessages --locale=ja_JP
Restart the mujinwww server and the new translation should be visible!