Giter Club home page Giter Club logo

Brasil.com.vc

Build Status

Installation

  1. Setup a new virtualenv: virtualenv .venv
  2. Install requirements: pip install -r requirements.txt
  3. Run tests to check setup: python manage.py test
  4. Configure your environment.
  5. Setup static files

Environment settings

Before running the Django server locally, you should set some environment- specific values, as defined below:

  • BASE_URL - Main URL where the app will be available (NO TRAILING SLASH!)
  • BLOG_URL - Blog URL.
  • CONTACT_EMAIL - Contact e-mail to be presented on footer.
  • CONTACT_PHONE - Contact phone to be presented on footer.
  • DATABASE_URL - Database connection URL (eg. postgres://user:pass@server:port/db)
  • DEBUG - Set debug mode ('true' or 'false')
  • DEFAULT_FROM_EMAIL - Email address to identify outcoming transactional emails
  • EMAIL_HOST_PASSWORD - Password to authenticate on the SMTP server
  • EMAIL_HOST_USER - Username to authenticate on the SMTP server
  • EMAIL_HOST - SMTP host name to be used for email sending
  • EMAIL_PORT - SMTP port to be used for email sending
  • FACEBOOK_API_KEY - Facebook app key (used for registration)
  • FACEBOOK_API_SECRET - Facebook app secret (used for registration)
  • GOOGLE_API_KEY - Google services API key
  • GOOGLE_ANALYTICS_ID - Google Analytics tracking ID
  • MAILING_ADDRESS - Physical address of the organization running the project
  • SECRET_KEY - Unique and secret salt for passwords, hashes and session keys
  • SENTRY_DSN - Optional. Use this to configure your Sentry DSN.
  • SNS_FACEBOOK - URL of the Facebook fan page
  • SNS_GOOGLEPLUS - URL of the Google+ page
  • SNS_TWITTER - URL of the Twitter profile

Setup the database

Brasil.com.vc is a GeoDjango application. We use PostGIS as our database, so you'll need to install some geospatial libraries, for that refer to the GeoDjango manual or follow the steps below.

PostGIS

Setup your PostGIS database:

  1. Install your PostgreSQL environment. Although you can easily setup a PostGIS-enabled PostgreSQL database through your OS' package manager, we recommend using Docker for this:

    docker run -d -p 5432:5432 --name bcv_db jamesbrink/postgresql

  2. Install Geospatial libraries on Linux or Mac OS X

  3. Create the database:

    docker exec bcv_db psql -U postgres -c "create database bcv;"

  4. Turn on PostGIS extensions:

    docker exec bcv_db psql -U postgres -c "create extension postgis;" bcv docker exec bcv_db psql -U postgres -c "create extension postgis_topology;" bcv

  5. Export the DATABASE_URL environment

    export DATABASE_URL="postgis://postgres:@$(docker port bcv_db 5432)/bcv"

SpatialLite

⚠️ Skip this section if you're setting up a production server.

  1. Set up SpatiaLite on your system.
  2. Set a new env var SPATIALITE_LIBRARY_PATH with your OS' library path.

Note the following:

  • You should create the database using the SpatiaLite bin before running migrations.
  • The built-in DATABASE_URL value expects a SpatiaLite database by default.

Setup static files

You must set up Node.js in order to make static files gathering and processing work.

  1. Install Node + npm. For OS X using Homebrew: brew install npm
  2. Install required packages: npm install npm will call bower after install

S3 is also supported as static server. To enable S3 support the following environment variables must be configured:

⚠️ when using S3 static backend you must use Python 2, reference.

  • STATIC_BACKEND - Set this to s3 to enable S3 support
  • AWS_ACCESS_KEY_ID - Your AWS access key ID
  • AWS_SECRET_ACCESS_KEY - Your AWS secret access key
  • AWS_STORAGE_BUCKET_NAME - Your bucket name
  • AWS_S3_CUSTOM_DOMAIN - Optional. A custom domain to be used

brasil.com.vc's Projects

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.