Skip to content
The code that generates the MDN Web Docs Developer Portal.
Branch: master
Clone or download
Latest commit 6357128 Jun 10, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
developerportal Remove buggy livereload #141 Jun 10, 2019
src
.editorconfig
.eslintignore Ensure linting ignores Sass files May 28, 2019
.gitignore
.gitlab-ci.yml Add missing env variables to GitLab CI config #54 May 28, 2019
CODE_OF_CONDUCT.md Create CODE_OF_CONDUCT.md May 28, 2019
Dockerfile Add article read time Jun 3, 2019
LICENSE Initial commit May 15, 2019
README.md Fix heading in README.md Jun 10, 2019
docker-compose.yml Remove buggy livereload #141 Jun 10, 2019
manage.py
package-lock.json Update package-lock.json May 28, 2019
package.json
requirements.txt Remove buggy livereload #141 Jun 10, 2019
setup.sh Add BASE_URL to .env file #141 Jun 10, 2019
webpack.config.js

README.md

Mozilla Developer Portal

Development workflow

Setup

Since this project uses Docker, you'll need to install Docker and Docker Compose to run this project locally.

To get set up in one-command, run:

./setup.sh

This command will create an .env file with unique keys, build docker images and containers, run database migrations, load fixture data, and prompt to create a superuser.

Running

With Docker Desktop running in the background, bring up the services built by the setup script by running:

docker-compose up

As you make changes, remember to run the tests…:

docker-compose exec app python manage.py test
docker-compose exec static npm run test

…and to make and apply database migrations:

docker-compose exec app python manage.py makemigrations
docker-compose exec app python manage.py migrate

Updating

After pulling master you may need to install new dependencies…:

docker-compose build

…or run database migrations:

docker-compose exec app python manage.py migrate

If things get messed up, you could (as a last resort) prune ALL Docker images, containers and volumes, and start from scratch:

./setup.sh --prune

Static site generation

A static file version of the site is generated using Wagtail Bakery which is built on top of Django Bakery

Usage

Build the site out as flat files to the /build folder (specified in settings/base.py):

docker-compose exec app python manage.py build

Check the built static site:

docker-compose exec app python manage.py buildserver 0.0.0.0:8080
You can’t perform that action at this time.