Giter Site home page Giter Site logo

vipul137 / website-2 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from okfn/website

0.0 0.0 0.0 13.44 MB

The code behind okfn.org

Home Page: https://okfn.org

License: MIT License

Shell 0.48% Python 50.75% HTML 24.75% JavaScript 2.31% Dockerfile 0.35% SCSS 21.36%

website-2's Introduction

okfn.org

Build Status Coverage Status

This is the Django/Django CMS project that runs http://okfn.org.

Prerequisites and assumptions

You must have the following installed:

  • Python 2.7
  • node

Also, the python packages being used require the following libraries to be installed:

  • libxml
  • libxslt
  • libsasl2
  • Python Imaging Library (PIL) dependencies, see here for a quick ubuntu instructions.

You may also wish to follow any install instructions inside a Python virtual environment. Explaining virtualenv is outside of the scope of this README, but this tutorial might help.

Running in development

Prepare the database. This step can be skipped if you'd like to use dummy SQLite database:

  • Get a dump of the database
  • Create a local database createdb okfn
  • Populate it psql okfn --file=/path/to/dump.sq or pg_restore -d okfn path/to/dump.dump

Cherry-pick environment variables from .env.example you'd like to set and add it to the .env file. Popular options:

  • CACHE_URL
  • DATABASE_URL
  • DJANGO_DEBUG
  • DJANGO_SECRET_KEY

Prepare the app:

pip install -r requirements.dev.txt
npm install
python manage.py migrate
python manage.py update_index

Start the server:

python manage.py runserver # dev
gunicorn foundation.wsgi:application --access-logfile '-' --error-logfile '-' # prod

Another option is to use Docker. For this one you should configure your database to work with remote connections using a proper IP address in the connection string or you should use default SQLite database (omit DATABASE_URL):

docker build -t okfn .
docker run -d -p 8888:80 -e DATABASE_URL=<change_me> -e <...> okfn

Static files

Static assets are collected and stored in a Amazon S3 Bucket, and served via Cloudfront CDN. To update the collected static files, make sure you have this env vars set:

AWS_STORAGE_BUCKET_NAME="okfn-org-production"
JANGO_USE_AWS_STORAGE="true"

AWS_ACCESS_KEY_ID="change-me"
AWS_SECRET_ACCESS_KEY="change-me"

To update the static files run

python manage.py collectstatic

Note that this will not update the images on the site as they are still served by Cloudfront. You need to invalidate the updated files using the AWS cli or web interface.

website-2's People

Contributors

nickstenning avatar nigelbabu avatar yotammanor avatar chris48s avatar amercader avatar smth avatar k-nut avatar roll avatar pwalsh avatar brew avatar tijptjik avatar tlacoyodefrijol avatar stephenabbott 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.