项目作者: City-of-Helsinki

项目描述 :
City of Helsinki Digital Helsinki Wagtail CMS
高级语言: Python
项目地址: git://github.com/City-of-Helsinki/digihel.git
创建时间: 2016-05-05T17:43:48Z
项目社区:https://github.com/City-of-Helsinki/digihel

开源协议:MIT License

下载


Digital Helsinki CMS

Build status
codecov
Requirements
Stories in Ready

This Wagtail-based CMS powers the Digital Helsinki website.

Installation

Set the DEBUG environment variable to 1

  1. export DEBUG=1

Install required Python packages

  1. (sudo) pip install -r requirements.txt

Create the database

  1. sudo -u postgres createuser digihel
  2. sudo -u postgres createdb -O digihel digihel

Install node dependencies

  1. npm install

Install bower components

  1. ./manage.py bower install

If you have acquired a database dump, install it this way:

  1. tar xvjf digihel-backup.tar.bz2
  2. pg_restore -d digihel digihel.sql
  3. echo "delete from wagtailimages_rendition;" | ./manage.py dbshell

Requirements

This project uses two files for requirements. The workflow is as follows.

requirements.txt is not edited manually, but is generated
with pip-compile.

requirements.txt always contains fully tested, pinned versions
of the requirements. requirements.in contains the primary, unpinned
requirements of the project without their dependencies.

In production, deployments should always use requirements.txt
and the versions pinned therein. In development, new virtualenvs
and development environments should also be initialised using
requirements.txt. pip-sync will synchronize the active
virtualenv to match exactly the packages in requirements.txt.

In development and testing, to update to the latest versions
of requirements, use the command pip-compile. You can
use requires.io to monitor the
pinned versions for updates.

To remove a dependency, remove it from requirements.in,
run pip-compile and then pip-sync. If everything works
as expected, commit the changes.

Configuration

These settings are recognized in the Django settings.

You can acquire the Twitter keys from the Twitter developer portal (https://apps.twitter.com).

  • TWITTER_CONSUMER_KEY: “Consumer Key (API Key)”
  • TWITTER_CONSUMER_SECRET: “Consumer Secret (API Secret)”
  • TWITTER_ACCESS_TOKEN: A personal (read-only) access token
  • TWITTER_ACCESS_TOKEN_SECRET: The secret for the personal (read-only) access token

Docker

Currently the development environment has been dockerized.

Configurations

Configure the following settings to local_settings.py:

  1. DEBUG = True
  2. DATABASES = {
  3. 'default': {
  4. 'ENGINE': 'django.db.backends.postgresql',
  5. 'NAME': 'postgres',
  6. 'USER': 'postgres',
  7. 'PASSWORD': 'postgres',
  8. 'HOST': 'db',
  9. 'PORT': '5432',
  10. }
  11. }

Daily running

  • Run docker-compose up
  • Run docker-compose exec web python3 manage.py migrate
  • Run docker-compose exec web python3 manage.py compilemessages