Quick Start Guide ================= Download TaskBuster Django Project Boilerplate ---------------------------------------------- First, you need to download the Boilerplate from GitHub. Secret Django Key ----------------- This boilerplate has the **DJANGO_KEY** setting variable hidden. You can generate your DJANGO_KEY |django_key|. .. |django_key| raw:: html here Project Name ------------ This project is named *TaskBuster*, so if you are using this Boilerplate to create your own project, you'll have to change the mane in few places: - *taskbuster_project* **folder** (your top project container) - *taskbuster_project/taskbuster* **folder** (your project name) - virtualenvironment names: **tb_dev** and **tb_test** (name them whatever you want) - in virtual environments **postactivate** files (see section below), you have to change **taskbuster.settings.development** for your **projectname.settings.development**. Same works for the testing environment. Virtual environments and Setting Files -------------------------------------- First, you must know your Python 3 path:: $ which python3 which is something similar to /usr/local/bin/python3. Next, create a Development virtual environment with Python3 installed:: $ mkvirtualenv --python=/usr/local/bin/python3 tb_dev where you might need to change it with your python path. Go to the virtual environment folder with:: $ cd $VIRTUAL_ENV/bin and edit the postactivate file.: $ vi postactivate You must add the line: :: export DJANGO_SETTINGS_MODULE="taskbuster.settings.development" export SECRET_KEY="your_secret_django_key" with your project name and your own secret key. Next, edit te **predeactivate** file and add the line:: unset SECRET_KEY Repeat the last steps for your testing environment:: $ mkvirtualenv --python=/usr/local/bin/python3 tb_test $ cd $VIRTUAL_ENV/bin $ vi postactivate where you have to add the lines:: export DJANGO_SETTINGS_MODULE="taskbuster.settings.testing" export SECRET_KEY="your_secret_django_key" and in the predeactivate file:: unset SECRET_KEY Next, install the packages in each environment:: $ workon tb_dev $ pip install -r requirements/development.txt $ workon tb_test $ pip install -r requirements/testing.txt Internationalization and Localization ------------------------------------- Settings ******** The default language for this Project is **English**, and we use internationalization to translate the text into Estonian. If you want to change the translation language, or include a new one, you just need to modify the **LANGUAGES** variable in the file *settings/base.py*. The language codes that define each language can be found |codes_link|. .. |codes_link| raw:: html here For example, if you want to use German you should include:: LANGUAGES = ( ... 'de', _("German"), ... ) You can also specify a dialect, like Luxenbourg's German with:: LANGUAGES = ( ... 'de-lu', _("Luxenbourg's German"), ... ) Note: the name inside the translation function _("") is the language name in the default language (English). More information on the |internationalization_post|. .. |internationalization_post| raw:: html Taskbuster post Translation *********** Go to the terminal, inside the taskbuster_project folder and create the files to translate with:: $ python manage.py makemessages -l et change the language "et" for your selected language. Next, go to the locale foldeer of your language:: $ cd taskbuster/locale/et/LC_MESSAGES where taskbuster is your project folder. You have to edit the file *django.po* and translate the strings. YOu can find more information about how to translate the strings |translation_strings_post|. .. |translation_strings_post| raw:: html here Once the translation is done, compile your messages with:: $ python manage.py compilemessages -l et Tests ***** We need to update the languages in our Tests to make sure the translation works correctly. Open the file *functional_tests/test_all_users.py*: - in **test_internationalization**, update you language with the translation of title text, here "Welcome to TaskBuster!" - in **test_localization**, update your languages. Useful commands --------------- Alist of all the commands used to run this template:: $ workon tb_dev $ workon tb_test $ python manage.py makemessages -l et $ python manage.py compilemessages -l et