docs
contains documentationprovision
contains provision code used for setting up the environment
- Install python (2.7)
- Install pip
- Install postgresql 9.3
- pip install -r requirements.txt
- Copy
config.json.sample
and rename it toconfig.json
. This file contains local configuration for each developer. Database connection information should be specified in this file - Setting up the database
python manage.py syncdb
- Migrate database schema
python manage.py migrate
- python manage.py runserver
- Use 4-space tab
- Use soft tab
- Variable name should be
variable_name
NOTvariableName
,Variable_Name
,VariableName
- Method name should be
method_name
NOTmethodName
,Method_Name
,MethodName
- Class name should be
ClassName
NOTClass_Name
- All models should be located in
core
app without any exceptions - Model classes are store in separated files (
user.py
is an example)
- Each person will work on their branch only. From master, do
git checkout -b tan
(replacetan
with your name) to start a new branch frommaster
- Before starting to work do
git pull origin master
to update the branch with latest changes - If possible, please include the ticket number in the commit message. For example,
git commit -m "#123 fix something"
- After finishing, push to your branch using
git push origin tan
(replacetan
with your branch name) - After that you can either tell the project manager in the ticket that you have finished it OR you can create a new merge request using github
- Do not touch
master
branch unless you know what you are doing
In this project, we are using South
to keep track of schema changes. Since we are having 4 people working on the same project, conflicts will probably happen quite often. Therefore, you need to keep in mind that you must discuss with others before changing the database schema
There are 2 steps to create new migration
- Making changes to the models, for example, adding another
CharField
- Run
python manage.py schemamigration core --auto
Apply the migration
- Run
python manage.py migrate
(Optional) There is also a chef (and vagrant) setting, that can be used to automatically configure the environment More info here