This repository serves the website of PyCon TW 2016. This project is open source and the license can be found in LICENSE.
- Git 1.8+
- Python 3.4+
Create your virtual environment:
python3 -m venv venv
And enable it:
. venv/bin/activate
You need to specify your python path when creating the virtual environment:
mkvirtualenv --python=$(which python3) pycontw2016
Just use pip:
pip install -r requirements.txt
Settings are stored in environment variables via django-environ. The quickiest way to start is to copy local.sample.env
into local.env
:
cp src/pycontw2016/settings/local.sample.env src/pycontw2016/settings/local.env
Then edit the SECRET_KEY
line in local.env
, replacing {{ secret_key }}
into any Django Secret Key value. An example:
SECRET_KEY=twvg)o_=u&@6^*cbi9nfswwh=(&hd$bhxh9iq&h-kn-pff0&&3
After that, just run the migration
cd
into the src
directory:
cd src
And migrate the database:
python manage.py migrate
Now you’re all set!
python manage.py runserver
Tests are managed with pytest-django. You have two options to run tests, either with the local environment, or in an isolated one via Tox.
Run the following command inside src
:
py.test
To run tests with coverage report:
py.test --cov=.
Run the following inside the top-level directory (the one with tox.ini
):
tox
Follow the GitHub Flow, please DO NOT push the commits into master directly. Always create branch by the feature you want to update. You are encouraged to submit a pull request for reviewing before merging things into master.
We strongly recommend you configure your editor to match our conding styles. You can do this manually, or use an EditorConfig plugin if your editor supports it. An .editorconfig
file has already been attached to the repository.
Translations are hosted on Transifex. When new commits are added into master branch, Travis CI will automatically push new translation strings to Transifex, so simply fix or edit the translation online.
Translation updates into code base are done manually under src/
. You need to configure the Transifex client first by adding the file ~/.transifexrc
.
Old translation files will stop tx pull
updating if they have later modified time, which they generally have when they are pulled from the remote repo. So old translation files should be removed first:
rm locale/zh_Hant/LC_MESSAGES/django.*
Run tx pull
to get newer translation and recompile the PO files:
tx pull -l zh-Hant
python manage.py compilemessages -l zh_Hant