DistrictDataLabs / cultivar

Multidimensional data explorer and visualization tool.
http://trinket.districtdatalabs.com
Apache License 2.0
52 stars 18 forks source link

Update readme/docs to document use of ENV variable for database settings #61

Closed looselycoupled closed 7 years ago

looselycoupled commented 8 years ago

For Heroku compatibility, the database connection should be an ENV string. Per @bbengfort's comment below see the travis yaml file for example usage and update the docs to reflect.

bbengfort commented 8 years ago

See the environment variables set in the .travis.yml file

On Thursday, June 2, 2016, Allen Leis notifications@github.com wrote:

The various environment settings files lack the proper database settings. Perhaps we should define it in the base.py file to use ENV variables (pulled from the .env file).

This might be accomplished by copying the version from test.py and then modifying it to use the env variables.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/DistrictDataLabs/trinket/issues/61, or mute the thread https://github.com/notifications/unsubscribe/AAth7v6ojsteCU9rz5dyahh1BxOcQVHHks5qHzfdgaJpZM4Is7iZ .

Sent from Gmail Mobile

bahadasx commented 7 years ago

@looselycoupled I checked the travis yaml file and there is only one database setting: DATABASE_URL.

The dev README shows adding a line to the .ENV file for this setting:

DATABASE_URL=postgres://<insertDBUSERNAME>:<insertDBUSERPASSWORD>@127.0.0.1:5432/<insertDBNAME>

Otherwise, I checked the testing.py settings file, and I see the following settings are being pulled from ENV variables:

DATABASES = {
    'default': {
          'ENGINE': 'django.db.backends.postgresql_psycopg2',
          'NAME': environ_setting('DB_NAME', 'trinket'),
          'USER': environ_setting('DB_USER', 'postgres'),
          'PASSWORD': environ_setting('DB_PASS', ''),
          'HOST': environ_setting('DB_HOST', 'localhost'),
          'PORT': environ_setting('DB_PORT', '5432'),
      },
  }

Could you clarify what the intent of this ticket is (e.g., to add something additional to documentation regarding that DATABASE_URL string or to add the database settings to the base.py file from testing.py)?

lauralorenz commented 7 years ago

Closed via #93.