Giter Club home page Giter Club logo

bluebottle's Introduction

Project Bluebottle

https://travis-ci.org/onepercentclub/bluebottle.png?branch=master https://coveralls.io/repos/github/onepercentclub/bluebottle/badge.svg?branch=master https://requires.io/github/onepercentclub/bluebottle/requirements.svg?branch=master

The repository for Project Bluebottle, the crowdsourcing framework initiated by GoodUp.

Contributors

For those who want to try out to the BlueBottle project, here's to get started:

  1. Fork and/or clone the repository.
  2. Navigate to your local repository directory.
  3. Create a bluebottle/settings/local.py base on bluebottle/settings/secrets.py.example

Now you have the option to install the application with, or without Docker. If you wish to not use Docker, continue below. Otherwise, see :ref:`docker`.

  1. Create a virtual environment within the repository directory, for example:

    $ virtualenv env
    $ source env/bin/activate
    
  2. Make sure you have a recent Python distro (3.7+ recommended).

  3. Make sure (a recent) virtualenv is installed.

  4. Install the project:

    $ pip install -e .[test]
    
  5. Migrate the database schemas:

    $ python manage.py migrate_schemas --shared --settings=bluebottle.settings.testing
    
  6. (optional) Create a new tenant (if you haven't imported a database dump):

    $ python manage.py create_tenant
    
  7. (optional) Re-index any imported data using Elasticsearch
    • For all tenants:

      $ python manage.py tenant_command search_index --rebuild -f
      
    • If for whatever reason this doesn't work, try running the migration step for a single tenant only, and indexing that tenant's data. E.g.:

      $ python manage.py migrate_schemas -s onepercent --settings=bluebottle.settings.testing
      $ python manage.py tenant_command --schema onepercent search_index --rebuild -f
      
  8. Start the server:

    $ python manage.py runserver
    
  9. You might still need to
    • Install libraries to get pip install working, like libxmlsec1, postgresql, postgis, elasticsearch 6.x
      • Installing these is not necessary when using Docker
    • Alter your hosts file (e.g. in /etc/hosts on Linux/OSX) to contain tenants you've created like:

      127.0.0.1 tenant35.localhost
      

Docker

It is possible to run thy Python server, PostgreSQL and Elasticsearch in a Docker environment using docker-compose. To get started, make sure to download a Docker client, like Docker Desktop.

Installation:

Make sure to download Docker (e.g. Docker Desktop) first.

In your local.py file, set the DATABASES variable to the following:

DATABASES = {
    'default': {
        'ENGINE': 'bluebottle.clients.postgresql_backend',
        'HOST': 'postgres',
        'PORT': '5432',
        'NAME': 'reef',
        'USER': 'postgres',
        'PASSWORD': 'postgres',
        'DISABLE_SERVER_SIDE_CURSORS': True # this prevents issues with connection pooling
    },
}

ELASTICSEARCH_DSL = {
    'default': {
        'hosts': 'elasticsearch:9200'
    },
}
  • To start the containers (if this is your first time, all dependencies will be installed automatically):

    $ docker-compose -u -d
    
  • To import a database dump file (please note that the last two commands run without the -t flag):

    $ docker exec -it -u postgres postgres dropdb reef
    $ docker exec -it -u postgres postgres createdb reef
    $ bzcat reef-prod-current.sql.bz2 | docker exec -i -u postgres postgres psql reef
    $ echo "UPDATE clients_client SET domain_url=CONCAT(client_name, '.localhost');" | docker exec -i -u postgres postgres psql reef
    
  • If you are running into errors related to max_map_count, then run the following command in your terminal: sysctl -w vm.max_map_count=262144

Running the containers:

To run the containers:

$ docker-compose -u -d

To run one specific container:

$ docker-compose -u -d [CONTAINER_NAME]

Or on other systems (some OSX):

$ docker compose up -d elasticsearch

To shut them down:

$ docker-compose down

The environment also comes with pgAdmin included so you can inspect the local database. Navigate to http://localhost:5050 and login with these credentials:

After that, you can add a new server using the details below to inspect the PostgreSQL database:

  • Host: host.docker.internal
  • Username: postgres
  • Password: postgres

To run commands in the Python container:

$ docker exec -it bluebottle python manage.py [YOUR_COMMAND]

- For example::

    $ docker exec -it bluebottle python manage.py migrate_schemas -s onepercent --settings=bluebottle.settings.local

If you need to rebuild the container, for example when you want to apply changes after pulling the latest version of a branch, run:

$ docker compose up --build

Testing

The BlueBottle test suite can be run completely using:

  1. Install the dependencies

    $ pip install -e .[test,dev]

  2. Create test db and restore testdata

    $ createdb test_reef $ psql test_reef < testdata.sql

  3. Run the tests

    $ python manage.py test -k

bluebottle's People

Contributors

aethemba avatar ashutoshb avatar benkonrath avatar danielkroon avatar enriquesalazar avatar eodolphi avatar franstwisk avatar gannetson avatar jakoblaegdsmand avatar jfterpstra avatar jhonm avatar joeribekker avatar jose-lpa avatar manuel-goodup avatar mauricekleine avatar mg84 avatar momchilovp avatar netogallo avatar pieter-rees avatar raux avatar rollick avatar sergei-maertens avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bluebottle's Issues

Required packages

  • Please add these packages as pre-requirement in Linux machines to README file:

libpqxx, graphviz

These are not installed on archlinux

  • python2 setup.py test and virtualenv2 env

Test

Testing webhook

Django 3

I see there is lots of work going on for Python 3 support at #4292

I tried my hand at leveraging off that to see if I can get Django 3 working, and am mostly successful in getting it operational enough to explore the app locally. I am using django-compat-patcher to do a lot of the heavy lifting of cross-Django-version compatibility.

Latest CI result at https://travis-ci.org/github/jayvdb/bluebottle/jobs/732862786
Summary: of 1228 tests, 225 failures & 184 errors.

A lot of the errors are repetitive, and most are due to the dependencies being pinned to Django 1.x compatible versions. I'm trying to unpin only dependencies that really need unpinning, so-as to reduce the variability between Django 1.x and Django 3.x versions of bluebottle.

Other dependent PRs / branches

Why Django 3?

  1. Because most dependency projects are already dropping Django 2, so if there are problems with porting to Django 2 it would be harder to get help,
  2. All top-tier distros have dropped Django 2 from their current or pending release, and
  3. I expect the Django 3 effort to take a while to stablise and before existing bluebottle production systems would be ready to switch to Django 3, and by then Django 2 will be even more dead.
  4. Creating migration across major Django versions is quite a bit of effort. May as well skip one.

Obviously most of this needs to wait until the Python 3 work lands, but I'd like to know the best way to structure this in order to get favourable reviews to get things merged early.

I'd like to eventually be running another Travis job for Django 3, so that Django 1.x and Django 3.x are co-existing in the repo until you're ready to switch off Django 1.x . Many of my patches are already able to co-exist on Django 1.x, using fallbacks where necessary. The Django 3 job could be allowed to fail, so that it doesnt halt ongoing development of the project.

Is BlueBottle still under development?

Hi there

We're going to run a crowdfunding website. There are not many options out there, but there are some apps as in: Bluebottle, Goteo (php), Catarse (ruby), openTilt (ruby), Thrinica (SAAS).

Anyway, Bluebottle is one of them that we see have not been under heavy development for years. Would you work on it again?

Do you recommend it as base of our website?

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.