Find the documentation at http://top-coding-party.readthedocs.org/en/latest/.
Submit tickets and issues at https://github.com/magopian/tcp/issues.
The source is available at https://github.com/magopian/tcp.
TCP is the accronym of TopCodingParty, http://topcodingparty.net.
The project stack is based on
- backend: Django, a Python based web development framework for perfectionists with deadlines
- frontend: HTML5 Boilerplate for the containing templates, Twitter Bootstrap for the layout and styling, SASS compiled CSS
Some of its features:
- Rate limited login
- Error logging using Sentry
- Makes use of HTML5, CSS3
- Easy two-step registration
Getting the code:
git clone git@github.com:magopian/tcp.git
cd tcp
virtualenv -p python2 env
source env/bin/activate
add2virtualenv .
pip install -r requirements.txt
Create tcp/settings.py
and put the minimal stuff in it:
from default_settings import *
ADMINS = ( ('Your name', 'email@example.com'),
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'tcp',
'USER': 'postgres',
},
}
SECRET_KEY = 'something secret'
TIME_ZONE = 'Europe/Paris'
EMAIL_HOST = 'mail.your_domain.com'
EMAIL_SUBJECT_PREFIX = '[TCP] '
Then deploy your application and run django-admin.py syncdb --settings=tcp.settings
to create the database tables, then django-admin.py migrate --settings=tcp.settings
to run all South migrations.
The very first time you launch the application, once the database is set up, you may want to load some example providers and matches. To do that, use the following command:
django-admin.py loaddata providers_matches.json --settings=tcp.settings
Be aware that if you do that again later, it will simply overwrite the entries, loosing your modifications to those entries, if any.
Install the development requirements:
pip install -r requirements-dev.txt
Run the tests:
make test
Or if you want to run the tests with django-admin.py
directly, make sure you use tcp.test_settings
.
If you want to contribute and need an environment more suited for development, you can use the settings.py
file to alter default settings. For example, to enable the django-debug-toolbar:
MIDDLEWARE_CLASSES += (
'debug_toolbar.middleware.DebugToolbarMiddleware',
)
INTERNAL_IPS = ('127.0.0.1',)
INSTALLED_APPS += (
'debug_toolbar',
)
DEBUG_TOOLBAR_CONFIG = {
'INTERCEPT_REDIRECTS': False,
'HIDE_DJANGO_SQL': False,
}
There's an improved flow all set up just for ease of development, with Foreman and Gorun. This flow has been inspired by Bruno Renié:
make gems play nice with virtualenv. Add this to your venv/bin/postactivate script:
export GEM_HOME="$VIRTUAL_ENV/gems" export GEM_PATH="" export PATH=$PATH:$GEM_HOME/bin
install the gems:
gem install bundler bundle install
start Foreman (which will start the development server, compile SASS files each time they're modified, run the tests on each code change):
foreman start
- make the validation optional (validation is costly), or even in another endpoint
- put together a compatibility matrix for the following platforms:
- Internet explorer 6
- Firefox 3
- Chrome
- Safari
- Opera
- iOS
- Android
- improve the validation "algorithm" to take corner cases into account