Giter Club home page Giter Club logo

metabrainz.org's Introduction

metabrainz.org

Website for the MetaBrainz Foundation. This is a Flask-based web application that provides info about the foundation and its supporters, accepts donations from users and organizations, and provides access to the replication packets for MusicBrainz.

Development setup

The easiest way to set up MetaBrainz website for development is to use Docker. Make sure that it is installed on your machine before following the instructions.

Configuration

Custom configuration must be stored in the file called custom_config.py. You can use an example one (custom_config.py.example) and tweak the configuration:

$ cp custom_config.py.example custom_config.py
$ vim custom_config.py

You need to make sure that required variables are set.

MusicBrainz OAuth

To allow users to log in, you'll need to set two keys: MUSICBRAINZ_CLIENT_ID and MUSICBRAINZ_CLIENT_SECRET. To obtain these keys, you need to register your instance of MetaBrainz.org on MusicBrainz at https://musicbrainz.org/account/applications/register. Set Callback URL field to http://<your host>/login/musicbrainz/post (if PREFERRED_URL_SCHEME in the config file is set to https, make sure that you specify the same protocol for callback URL). If you run server locally, replace <your host> with localhost.

Payments

Next is the configuration of the payment systems. We use PayPal and WePay to accept donations to our foundation. For WePay you need to set your access token (WEPAY_ACCESS_TOKEN) and account ID (WEPAY_ACCESS_TOKEN). PayPal is a bit more complicated. PAYPAL_PRIMARY_EMAIL is an address that should receive all the payments. PAYPAL_BUSINESS is an address for non-donations; all payments sent there will be ignored.

After these settings have been set and you are sure that your configuration is working properly with in test mode, you can flip the switch. Set DEBUG to False and PAYMENT_PRODUCTION to True. WARNING! For development purposes you should only use payments in debug mode.

Serving replication packets

Replication packets must be copied into ./data/replication_packets directory. It must have the following structure:

./data/replication_packets/
    - hourly replication packets

./data/replication_packets/daily/
    - daily replication packets

./data/replication_packets/weekly/
    - weekly replication packets

Startup

This command will build and start all the services that you will be able to use for development:

$ docker-compose -f docker/docker-compose.dev.yml up --build -d

The first time you set up the application, database tables need to be created:

$ docker-compose -f docker/docker-compose.dev.yml run web python manage.py create_tables

Web server should now be accessible at http://localhost:80/.

Translations

Extracting strings

Once you have built and started all the services as mentioned above, run:

$ docker-compose -f docker/docker-compose.dev.yml run web python manage.py extract_strings

Compiling the strings

The POT files are compiled automatically every time the services are built, but in case you make any changes to the POT files and want to compile the translation files again, run:

$ docker-compose -f docker/docker-compose.dev.yml run web python manage.py compile_translations

Testing

To run all tests use:

$ py.test

or with Docker:

$ docker-compose -f docker/docker-compose.test.yml up --build --remove-orphans

Testing donations

Before doing anything make sure that PAYMENT_PRODUCTION variable in configuration file is set to False! This way you'll use testing environments where credit cards and bank accounts are not actually charged. More info about testing environments for each payment service can be found in their documentation:

Please note that in order for IPNs to work, application MUST be publicly available. If you are doing development on your local machine it is likely that your callback endpoints will not be reachable from payment processors.

metabrainz.org's People

Contributors

gentlecat avatar mayhem avatar freso avatar caroline-gschwend avatar chirlu avatar dpmittal avatar navap avatar anshuman73 avatar reosarevok avatar mineo avatar ianmcorvidae avatar lalinsky avatar mwiencek avatar eebigger avatar

Watchers

iapilgrim avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.