A simple application for creating user community maps powered by Flask.
Prerequisites:
- Python 2.7.x
- PostgreSQL or MySQL database
- pip and (optional) virtualenv
Once you have all prerequisites, the following steps will bootstrap the project:
-
Grab the source code.
git clone git://github.com/id-python/members.git cd members
-
Activate your virtual environment (or you can skip this step if you're not using
virtualenv
). -
Install all dependencies using
pip
:pip install -r requirements.txt
Note: the installation process may take awhile.
By default, this app reads configuration from users/default_config.py
.
To override values set in default config, simply copy the contents
of users/default_config.py
and save it elsewhere.
cp users/default_config.py /path/to/custom/config.py
Then edit the custom config file, setting appropriate values as needed.
Things you might need to override:
-
SQLALCHEMY_DATABASE_URI
Since this project tested using PostgreSQL and likely will running on MySQL as well, there's extra package you need to install to before running the app.
pip install psycopg2
for PostgreSQLpip install mysql-python
for MySQL
Just pick one and please refer to http://docs.sqlalchemy.org/en/rel_0_9/core/engines.html for details.
Ensure your database schema is up-to-date by invoking this command:
USERS_CONFIG=/path/to/custom/config.py python manage.py db upgrade
Running the app will be as simple as:
USERS_CONFIG=/path/to/custom/config.py python manage.py runserver
Each config item is overridable through environment variable. For instance, if you want to suppress email delivery, simply set appropriate value:
USERS_CONFIG=/path/to/custom/config.py USERS_MAIL_SUPPRESS_SEND=1 python manage.py runserver
NOTE: It is highly-recommended that you're creating a separate database and config file for testing.
To run testcases:
USERS_CONFIG=/path/to/custom/testing_config.py ./runtests.sh
Each config item is overridable through environment variable. For instance, if you want to suppress email delivery, simply set appropriate value:
USERS_CONFIG=/path/to/custom/testing_config.py USERS_MAIL_SUPPRESS_SEND=1 ./runtests.sh
- Fork this repo.
- Create a topic branch in your forked repo and start hacking.
- Run
runtests.sh
. Ensure all tests passed. - Once it done, submit your pull request (PR) against upstream
develop
branch. - Our maintainers will review your PR. If it's good — all tests passed and proposed feature is in our roadmap — your PR will be merged.
Tim Sutton and Akbar Gumbira