Skip to content

Commit bd7ab70

Browse files
committed
add sections about development and testing
1 parent 5ac5717 commit bd7ab70

1 file changed

Lines changed: 47 additions & 9 deletions

File tree

README.md

Lines changed: 47 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,32 @@ User Map
33

44
A simple application for creating user community maps powered by Flask.
55

6-
Hacking
7-
-------
6+
Installation
7+
------------
8+
9+
Prerequisites:
10+
11+
* Python 2.7.x
12+
* PostgreSQL or MySQL database
13+
* pip and (optional) virtualenv
14+
15+
Once you have all prerequisites, the following steps will bootstrap the project:
16+
17+
1. Grab the source code.
18+
19+
git clone git://github.com/id-python/members.git
20+
cd members
21+
22+
2. Activate your virtual environment (or you can skip this step if you're not using `virtualenv`).
23+
24+
3. Install all dependencies using `pip`:
25+
26+
pip install -r requirements.txt
27+
28+
Note: the installation process may take awhile.
29+
30+
Development
31+
-----------
832

933
By default, this app reads configuration from `users/default_config.py`.
1034
To override values set in default config, simply copy the contents
@@ -16,28 +40,42 @@ Then edit the custom config file, setting appropriate values as needed.
1640

1741
Things you might need to override:
1842

19-
* `SQLALCHEMY_DATABASE_URI` — refer to http://docs.sqlalchemy.org/en/rel_0_9/core/engines.html for details
43+
* `SQLALCHEMY_DATABASE_URI`
44+
45+
Since this project tested using PostgreSQL and __likely__ will running on MySQL as well,
46+
there's extra package you need to install to before running the app.
2047

21-
To install dependencies:
48+
* `pip install psycopg2` for PostgreSQL
49+
* `pip install mysql-python` for MySQL
2250

23-
pip install -r requirements.txt
51+
Just pick one and please refer to http://docs.sqlalchemy.org/en/rel_0_9/core/engines.html for details.
2452

25-
Before running the server/testcase, ensure database is up-to-date:
53+
Ensure your database schema is up-to-date by invoking this command:
2654

2755
USERS_CONFIG=/path/to/custom/config.py python manage.py db upgrade
2856

29-
To run the development server:
57+
Running the app will be as simple as:
3058

3159
USERS_CONFIG=/path/to/custom/config.py python manage.py runserver
3260

3361
Each config item is overridable through environment variable.
3462
For instance, if you want to suppress email delivery, simply set appropriate value:
3563

36-
USERS_CONFIG=/path/to/custom/config.py USERS_MAIL_SUPPRESS_SEND=True python manage.py runserver
64+
USERS_CONFIG=/path/to/custom/config.py USERS_MAIL_SUPPRESS_SEND=1 python manage.py runserver
65+
66+
Testing
67+
-------
68+
69+
NOTE: It is highly-recommended that you're creating a separate database and config file for testing.
3770

3871
To run testcases:
3972

40-
USERS_CONFIG=/path/to/custom/config.py USERS_MAIL_SUPPRESS_SEND=True ./runtests.sh
73+
USERS_CONFIG=/path/to/custom/testing_config.py ./runtests.sh
74+
75+
Each config item is overridable through environment variable.
76+
For instance, if you want to suppress email delivery, simply set appropriate value:
77+
78+
USERS_CONFIG=/path/to/custom/testing_config.py USERS_MAIL_SUPPRESS_SEND=1 ./runtests.sh
4179

4280
Collaboration
4381
-------------

0 commit comments

Comments
 (0)