Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

First pass at Playdoh -> Fjord

  • Loading branch information...
commit eebed8d7c396518bb9d11e204562728b60e1ef32 1 parent 4f863cc
@willkg willkg authored
View
2  LICENSE
@@ -1,4 +1,4 @@
-Copyright (c) 2011, Mozilla
+Copyright (c) 2012, Mozilla Foundation
All rights reserved.
Redistribution and use in source and binary forms, with or without
View
23 README.md
@@ -1,23 +0,0 @@
-playdoh
-=======
-
-Mozilla's Playdoh is a web application template based on [Django][django].
-
-Patches are welcome! Feel free to fork and contribute to this project on
-[github][gh-playdoh].
-
-Full [documentation][docs] is available as well.
-
-
-[django]: http://www.djangoproject.com/
-[gh-playdoh]: https://github.com/mozilla/playdoh
-[docs]: http://playdoh.rtfd.org/
-
-
-License
--------
-This software is licensed under the [New BSD License][BSD]. For more
-information, read the file ``LICENSE``.
-
-[BSD]: http://creativecommons.org/licenses/BSD/
-
View
5 README.rst
@@ -0,0 +1,5 @@
+=======
+ Fjord
+=======
+
+FIXME
View
40 docs/build-github.zsh
@@ -1,40 +0,0 @@
-#!/bin/zsh
-
-# A useful build script for projects hosted on github:
-# It can build your Sphinx docs and push them straight to your gh-pages branch.
-
-# Should be run from the docs directory: (cd docs && ./build-github.zsh)
-
-REPO=$(git config remote.origin.url)
-HERE=$(dirname $0)
-GH=$HERE/_gh-pages
-
-
-# Checkout the gh-pages branch, if necessary.
-if [[ ! -d $GH ]]; then
- git clone $REPO $GH
- pushd $GH
- git checkout -b gh-pages origin/gh-pages
- popd
-fi
-
-# Update and clean out the _gh-pages target dir.
-pushd $GH
-git pull && rm -rf *
-popd
-
-# Make a clean build.
-pushd $HERE
-make clean dirhtml
-
-# Move the fresh build over.
-cp -r _build/dirhtml/* $GH
-pushd $GH
-
-# Commit.
-git add .
-git commit -am "gh-pages build on $(date)"
-git push origin gh-pages
-
-popd
-popd
View
16 docs/conf.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
-# playdoh documentation build configuration file, created by
+# fjord documentation build configuration file, created by
# sphinx-quickstart on Tue Jan 4 15:11:09 2011.
#
# This file is execfile()d with the current directory set to its containing dir.
@@ -40,17 +40,17 @@
master_doc = 'index'
# General information about the project.
-project = u'a playdoh-based project'
-copyright = u'2011, the authors'
+project = u'a fjord-based project'
+copyright = u'2012, Mozilla Foundation'
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
-version = '1.0'
+version = 'dev'
# The full version, including alpha/beta/rc tags.
-release = '1.0'
+release = 'dev'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
@@ -164,7 +164,7 @@
#html_file_suffix = None
# Output file base name for HTML help builder.
-htmlhelp_basename = 'playdohdoc'
+htmlhelp_basename = 'fjorddoc'
# -- Options for LaTeX output --------------------------------------------------
@@ -178,7 +178,7 @@
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title, author, documentclass [howto/manual]).
latex_documents = [
- ('index', 'playdoh.tex', u'playdoh Documentation',
+ ('index', 'fjord.tex', u'fjord Documentation',
u'Mozilla', 'manual'),
]
@@ -211,7 +211,7 @@
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
- ('index', 'a-playdoh-app', u"a-playdoh-app's Documentation",
+ ('index', 'a-fjord-app', u"a-fjord-app's Documentation",
[u'the authors'], 1)
]
View
8 docs/contactus.rst
@@ -0,0 +1,8 @@
+.. _contact-us-chapter:
+
+==========
+Contact us
+==========
+
+:irc: #input on irc.mozilla.org
+:new bugs: https://bugzilla.mozilla.org/enter_bug.cgi?product=Input&rep_platform=all&op_sys=all
View
36 docs/contributors.rst
@@ -0,0 +1,36 @@
+.. _contributors-chapter:
+
+==================
+Join this project!
+==================
+
+Fjord is the software that will run `Input (input.mozilla.org)
+<http://input.mozilla.org/>`_ which allows Mozilla project to gather
+feedback from its user base.
+
+Interested in helping out? Here's a bunch of things we need your help
+with.
+
+
+Help with hacking!
+==================
+
+First step is to set up Fjord so you can run it and hack on it. For
+that, see the :ref:`hacking-howto-chapter`.
+
+If you have problems, please let us know! See
+:ref:`contact-us-chapter`.
+
+After you've got it up and running, come say hi!
+
+
+Help with making Fjord easier for hacking on!
+=============================================
+
+We're working on making Fjord easier to hack on. This entails:
+
+* making this documentation better
+
+Any thoughts you have on making this easier are much
+appreciated. Further, if you could help us, that'd be valuable to us
+and all those who follow in your footsteps.
View
69 docs/conventions.rst
@@ -0,0 +1,69 @@
+===========
+Conventions
+===========
+
+This document contains coding conventions, and things to watch out
+for, etc.
+
+
+Coding conventions
+==================
+
+We follow most of the practices as detailed in the `Mozilla webdev
+bootcamp guide
+<http://mozweb.readthedocs.org/en/latest/coding.html>`_.
+
+If you don't have an editor that checks PEP-8 issues and runs pyflakes
+for you, it's worth setting it up. Use `check.py
+<https://github.com/jbalogh/check>`_ because it's awesome.
+
+
+Git conventions
+===============
+
+Git workflow
+------------
+
+We use a rebase-based workflow.
+
+
+Git commit messages
+-------------------
+
+Git commit messages should have the following form::
+
+ [bug xxxxxxx] Short summary
+
+ Longer explanation with paragraphs and lists and all that where
+ each line is under 72 characters.
+
+ * bullet 1
+ * bullet 2
+
+ Etc. etc.
+
+
+Summary line should be capitalized, short and shouldn't exceed 50
+characters. Why? Because this is a convention many git tools take
+advantage of.
+
+If the commit relates to a bug, the bug should show up in the summary
+line in brackets.
+
+There should be a blank line between the summary and the rest of the
+commit message. Lines shouldn't exceed 72 characters.
+
+See `these guidelines
+<http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html>`_
+for some more explanation.
+
+
+Git resources and tools
+-----------------------
+
+See `Webdev bootcamp guide
+<http://mozweb.readthedocs.org/en/latest/git.html#git-and-github>`_
+for:
+
+* helpful resources for learning git
+* helpful tools
View
382 docs/hacking_howto.rst
@@ -0,0 +1,382 @@
+.. _hacking-howto-chapter:
+
+==============================
+Hacking HOWTO for Contributors
+==============================
+
+
+Summary
+=======
+
+This chapter helps you get a minimal installation of Fjord up and
+running so as to make it easier for contributing.
+
+If you're interested in setting up Fjord for a production
+deployment, this is not the chapter for you---look no further!
+
+If you have any problems getting Fjord running, let us know. See the
+:ref:`contact-us-chapter`.
+
+
+Operating systems
+=================
+
+Windows
+-------
+
+If you're using Windows as your operating system, you'll need to set
+up a virtual machine and run Fjord in that. Fjord won't run in
+Windows.
+
+If you've never set up a virtual machine before, let us know and we
+can walk you through it. Having said that, it's not easy to do for
+people who haven't done it before.
+
+
+Mac OSX
+-------
+
+Just follow along with the instructions below. Several of us use OSX,
+so if you run into problems, let us know.
+
+
+Linux
+-----
+
+We know these work in Debian Testing (Wheezy) and will probably work
+in Debian derivatives like Ubuntu. It's likely that you'll encounter
+some steps that are slightly different. If you run into problems, let
+us know.
+
+
+Requirements
+============
+
+FIXME - everything below this point is probably wrong.
+
+For the minimum installation, you'll need the following:
+
+* git
+* Python 2.6 or 2.7
+* `pip <http://www.pip-installer.org/en/latest/>`_
+* MySQL server and client headers
+* Memcached Server
+* libxml and headers
+* libxslt and headers
+* libjpeg and headers
+* zlib and headers
+
+Installation for these is very system dependent. Using a package
+manager, like yum, aptitude, or brew, is encouraged.
+
+
+Getting the Source
+==================
+
+Grab the source from Github using::
+
+ $ git clone --recursive git://github.com/mozilla/fjord.git
+ $ cd fjord
+
+.. Note::
+
+ If you forgot to add ``--recursive``, you can get all the
+ submodules with::
+
+ $ git submodule update --init --recursive
+
+
+Installing dependencies
+=======================
+
+Compiled Packages
+-----------------
+
+There are a small number of compiled packages, including the MySQL
+Python client.
+
+You can install these either with your system's package manager or
+with ``pip``.
+
+To use pip, do this::
+
+ $ sudo pip install -r requirements/compiled.txt
+
+If you want to use your system's package manager, you'll need to go
+through ``requirements/compiled.txt`` and install the dependencies by
+hand.
+
+
+Python Packages
+---------------
+
+All the pure-Python requirements are provided in the ``vendor``
+directory, also known as the "vendor library". This makes the packages
+available to Python without installing them globally and keeps them
+pinned to known-compatible versions.
+
+See the :ref:`vendor library <vendor-chapter>` documentation for more
+information on getting the vendor lib and keeping it up to date.
+
+
+Set up the database
+===================
+
+We need to create a database user and a database table. These
+instructions assume you use:
+
+:database: fjord
+:username: fjord
+:password: password
+
+::
+
+ $ mysql -u root -p
+ mysql> CREATE DATABASE fjord;
+ mysql> create user 'fjord'@'localhost' identified by 'password';
+ mysql> GRANT ALL ON fjord.* TO 'fjord'@'localhost' IDENTIFIED BY 'password';
+
+
+.. Note::
+
+ If you use different values, make sure to substitute your values in the
+ correct places in the rest of the instructions.
+
+
+Configuration
+=============
+
+Start by creating a file named ``settings_local.py`` in the
+``fjord`` directory. Start with this::
+
+ from settings import *
+
+ DEBUG = True
+ TEMPLATE_DEBUG = DEBUG
+ SESSION_COOKIE_SECURE = False
+
+ # Allows you to run Fjord without running Celery---all tasks
+ # will be done synchronously.
+ CELERY_ALWAYS_EAGER = True
+
+ # Allows you to specify waffle settings in the querystring.
+ WAFFLE_OVERRIDE = True
+
+ # Change this to True if you're going to be doing search-related
+ # work.
+ ES_LIVE_INDEXING = False
+
+ # Basic cache configuration for development.
+ CACHES = {
+ 'default': {
+ 'BACKEND': 'caching.backends.memcached.CacheClass',
+ 'LOCATION': 'localhost:11211'
+ }
+ }
+
+ CACHE_MACHINE_USE_REDIS = True
+ CACHE_MIDDLEWARE_ALIAS = 'default'
+ CACHE_MIDDLEWARE_KEY_PREFIX = ''
+ CACHE_MIDDLEWARE_SECONDS = 600
+
+ # Basic database configuration for development.
+ DATABASES = {
+ 'default': {
+ 'NAME': 'fjord',
+ 'ENGINE': 'django.db.backends.mysql',
+ 'HOST': 'localhost',
+ 'USER': 'fjord',
+ 'PASSWORD': 'password',
+ 'OPTIONS': {'init_command': 'SET storage_engine=InnoDB'},
+ 'TEST_CHARSET': 'utf8',
+ 'TEST_COLLATION': 'utf8_unicode_ci',
+ },
+ }
+
+ REDIS_BACKENDS = {
+ 'default': 'redis://localhost:6379?socket_timeout=0.5&db=0',
+ 'karma': 'redis://localhost:6381?socket_timeout=0.5&db=0',
+ 'helpfulvotes': 'redis://localhost:6379?socket_timeout=0.\
+ 5&db=1',
+ }
+
+ REDIS_BACKEND = REDIS_BACKENDS['default']
+
+ LESS_PREPROCESS = True
+
+Now you can copy and modify any settings from ``settings.py`` into
+``settings_local.py`` and the value will override the default.
+
+
+memcached
+---------
+
+If you are running Red Hat/CentOS/Fedora, once you have installed memcached you
+can start it and configure it to run on startup using::
+
+ $ chkconfig memcached on
+ $ /etc/init.d/memcached start
+ $ service memcached start
+
+.. Note::
+
+ This should probably be somewhere else, but the easy way to flush
+ your cache is something like this::
+
+ echo "flush_all" | nc localhost 11211
+
+ Assuming you have memcache configured to listen to 11211.
+
+
+LESS
+----
+
+To install LESS you will first need to `install Node.js and NPM
+<https://github.com/joyent/node/wiki/Installing-Node.js-via-package-manager>`_.
+
+Now install LESS using::
+
+ $ sudo npm install less
+
+Ensure that lessc (might be located at /usr/lib/node_modules/less/bin) is
+accessible on your PATH.
+
+
+Running redis
+-------------
+
+This script runs all three servers---one for each configuration.
+
+I (Will) put that in a script that creates the needed directories in
+``/var/redis/`` and kicks off the three redis servers::
+
+ #!/bin/bash
+
+ set -e
+
+ # Adjust these according to your setup!
+ REDISBIN=/usr/bin/redis-server
+ CONFFILE=/path/to/conf/files/
+
+ if test ! -e /var/redis/sumo/
+ then
+ echo "creating /var/redis/sumo/"
+ mkdir -p /var/redis/sumo/
+ fi
+
+ if test ! -e /var/redis/sumo-test/
+ then
+ echo "creating /var/redis/sumo-test/"
+ mkdir -p /var/redis/sumo-test/
+ fi
+
+ if test ! -e /var/redis/sumo-persistent/
+ then
+ echo "creating /var/redis/sumo-persistent/"
+ mkdir -p /var/redis/sumo-persistent/
+ fi
+
+ $REDISBIN $CONFFILE/redis-persistent.conf
+ $REDISBIN $CONFFILE/redis-test.conf
+ $REDISBIN $CONFFILE/redis-volatile.conf
+
+
+Database
+--------
+
+At a minimum, you will need to define a database connection. See above
+for a sample database configuration.
+
+Note the two settings ``TEST_CHARSET`` and ``TEST_COLLATION``. Without
+these, the test suite will use MySQL's (moronic) defaults when
+creating the test database (see below) and lots of tests will
+fail. Hundreds.
+
+Create the database and grant permissions to the user, based on your
+database settings. For example, using the settings above::
+
+ $ mysql -u root -p
+ mysql> CREATE DATABASE fjord;
+ mysql> GRANT ALL ON fjord.* TO fjord@localhost IDENTIFIED BY \
+ 'password';
+
+To load the latest database schema, use ``scripts/schema.sql`` and
+``schematic``::
+
+ $ mysql -u fjord -p fjord < scripts/schema.sql
+ $ ./vendor/src/schematic/schematic migrations/
+
+You'll now have an empty but up-to-date database!
+
+Finally, you'll probably want to create a superuser. Just use Django's
+``createsuperuser`` management command::
+
+ $ ./manage.py createsuperuser
+
+and follow the prompts. After logging in, you can create a profile for
+the user by going to ``/users/edit`` in your browser.
+
+See also the :ref:`important wiki documents <wiki-chapter>`
+documentation.
+
+
+Product Details Initialization
+------------------------------
+
+One of the packages Fjord uses, ``product_details``, needs to fetch
+JSON files containing historical Firefox version data and write them
+within its package directory. To set this up, run this command to do
+the initial fetch::
+
+ $ ./manage.py update_product_details
+
+
+Testing it out
+==============
+
+To start the dev server, run ``./manage.py runserver``, then open up
+``http://localhost:8000``.
+
+If everything's working, you should see a somewhat empty version of
+the SUMO home page!
+
+
+Running the tests
+-----------------
+
+A great way to check that everything really is working is to run the
+test suite. You'll need to add an extra grant in MySQL for your
+database user::
+
+ $ mysql -u root -p
+ mysql> GRANT ALL ON test_NAME.* TO USER@localhost;
+
+Where ``NAME`` and ``USER`` are the same as the values in your
+database configuration.
+
+The test suite will create and use this database, to keep any data in
+your development database safe from tests.
+
+Running the test suite is easy::
+
+ $ ./manage.py test -s --noinput --logging-clear-handlers
+
+For more information, see the :ref:`test documentation
+<tests-chapter>`.
+
+
+Advanced install
+================
+
+This page covers a minimal install. This minimal install lets you run
+Fjord and work on many parts of Fjord. However, it's missing some
+components.
+
+The following aren't installed in this guide:
+
+* Redis
+* RabbitMQ
+* Elastic Search
+
+For installing and configuring those components, you should look at
+the more comprehensive :ref:`installation-chapter`.
View
28 docs/index.rst
@@ -1,26 +1,18 @@
-========================================
-Welcome to this project's documentation!
-========================================
+=================================
+Welcome to Fjord's documentation!
+=================================
-This is a documentation template for a **web application based on Playdoh**.
-Feel free to change this to your liking.
-
-
-About playdoh
--------------
-
-This project is based on **playdoh**. Mozilla's Playdoh is an open source
-web application template based on `Django <http://www.djangoproject.com/>`_.
-
-To learn more about it, step by the `playdoh project page
-<https://github.com/mozilla/playdoh>`_.
-
-Contents
---------
+Part 1: Contributor's Guide
+===========================
.. toctree::
:maxdepth: 1
+ contributors
+ hacking_howto
+ conventions
+
+
Indices and tables
------------------
View
22 fjord/settings/local.py-dist
@@ -9,11 +9,10 @@ from . import base
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
- 'NAME': 'playdoh_app',
- 'USER': 'root',
- 'PASSWORD': '',
- 'HOST': '',
- 'PORT': '',
+ 'NAME': 'fjord',
+ 'USER': 'fjord',
+ 'PASSWORD': 'password',
+ 'HOST': 'localhost',
'OPTIONS': {
'init_command': 'SET storage_engine=InnoDB',
'charset' : 'utf8',
@@ -22,9 +21,6 @@ DATABASES = {
'TEST_CHARSET': 'utf8',
'TEST_COLLATION': 'utf8_general_ci',
},
- # 'slave': {
- # ...
- # },
}
# Uncomment this and set to all slave DBs in use on the site.
@@ -67,15 +63,15 @@ ENGAGE_ROBOTS = True
# CELERY_ALWAYS_EAGER = False # required to activate celeryd
# BROKER_HOST = 'localhost'
# BROKER_PORT = 5672
-# BROKER_USER = 'playdoh'
-# BROKER_PASSWORD = 'playdoh'
-# BROKER_VHOST = 'playdoh'
+# BROKER_USER = 'fjord'
+# BROKER_PASSWORD = 'fjord'
+# BROKER_VHOST = 'fjord'
# CELERY_RESULT_BACKEND = 'amqp'
## Log settings
-# SYSLOG_TAG = "http_app_playdoh" # Make this unique to your project.
-# LOGGING = dict(loggers=dict(playdoh={'level': logging.DEBUG}))
+# SYSLOG_TAG = "http_app_fjord" # Make this unique to your project.
+# LOGGING = dict(loggers=dict(fjord={'level': logging.DEBUG}))
# Common Event Format logging parameters
#CEF_PRODUCT = 'Playdoh'
Please sign in to comment.
Something went wrong with that request. Please try again.