Find a file
Lars Eggert cf629a42ad And more fixes.
- Legacy-Id: 19877
2022-01-25 10:14:25 +00:00
.devcontainer Adjust docker volume mounting strategy. 2021-11-11 17:20:20 +00:00
.vscode misc: import docker improvements from 7.39.1.dev2 2021-11-10 21:51:55 +00:00
bin Replace bower with npm/parcel. 2021-11-24 15:10:39 +00:00
buildbot Removed Henrik from several places that would send him mail at his request. 2021-03-04 18:44:09 +00:00
data Updated docker-related files based on 6.17.0 2016-03-22 21:10:33 +00:00
docker When using Docker, the runserver isn't being accessed over loopback, so we need 2022-01-06 11:20:49 +00:00
etc Removed the crontab, because of too many drawbacks. 2016-06-17 13:07:52 +00:00
hooks Captured the last of the current commit hooks. Fixes #3297. Commit ready for merge. 2021-06-02 16:24:58 +00:00
ietf And more fixes. 2022-01-25 10:14:25 +00:00
media Updated some svn:ignore lists. 2017-12-18 17:25:00 +00:00
notes Move items from PLAN into Trac or to the notes directory. Commit ready for merge. 2021-07-09 16:36:05 +00:00
patch Remove oic patch - 1.3.0 contains the fix. Commit ready for merge. 2021-07-14 18:31:45 +00:00
pyzmail Pyflakes fixes to our copy of pyzmail 2019-07-22 18:27:49 +00:00
test Add some ignores 2021-11-09 11:57:49 +00:00
vzic Changed the plain UTC.ics zoneinfo entry from symlink to file. 2020-09-16 18:16:28 +00:00
.bowerrc Added a .bowerrc pointing to the new bower registry location. 2018-09-30 14:09:44 +00:00
.editorconfig Merged in [10551] and [10553] from lars@netapp.com: 2015-12-15 19:12:46 +00:00
.eslintrc.js Switch to list.js 2021-11-22 09:21:32 +00:00
.gitignore Dump a bunch of stuff from my local branch into svn. 2021-11-09 13:54:17 +00:00
.pylintrc Added a pylint rc-file, and fixed or silenced a number of issues found by pylint using the settings .pylintrc (which enable only error checking). 2016-09-08 14:48:59 +00:00
changelog Changelog entry for 7.40.0 2021-11-18 16:07:23 +00:00
changelog.py Python2/3 compatibility: replaced six.ensure_text() with either six.text_type or django's force_text(), depending on the case, and fixed a variable scope issue. 2019-07-16 13:20:05 +00:00
control Removed Henrik from several places that would send him mail at his request. 2021-03-04 18:44:09 +00:00
debug.py Added a couple of functions to debug.py 2020-06-06 20:12:00 +00:00
hold-for-merge Merged in ^/personal/jennifer/7.39.1.dev2 from jennifer@painless-security.com: 2021-11-09 18:26:47 +00:00
INSTALL Updated the installation instructions based on feedback from mlarson@amsl.com. 2017-01-26 19:19:24 +00:00
LICENSE.md Update some documentation (and convert to Markdown.) 2021-11-24 15:05:26 +00:00
mypy.ini Added a mypy .ini file 2019-09-30 15:38:22 +00:00
package-lock.json And more fixes. 2022-01-25 10:14:25 +00:00
package.json And more fixes. 2022-01-25 10:14:25 +00:00
README.md Update some documentation (and convert to Markdown.) 2021-11-24 15:05:26 +00:00
ready-for-merge Adjust the merge queue 2021-11-16 18:40:32 +00:00
release-coverage.json.gz Code coverage data for release 7.40.0 2021-11-18 16:07:14 +00:00
requirements.txt And more fixes. 2022-01-25 10:14:25 +00:00
tzparse.py Initial 2to3 patch with added copyright statement updates. 2019-06-27 14:40:54 +00:00

IETF Datatracker

Intro

We now use npm to manage assets for the Datatracker, and parcel to package them. npm maintains its node packages under node_modules.

The Datatracker includes these packages from the various Javascript and CSS files in ietf/static/js and ietf/static/css, respectively. Static images are likewise in ietf/static/images.

Whenever changes are made to the files under ietf/static, you must re-run parcel to package them:

npx parcel build

This will create packages under ietf/static/dist/ietf, which are then served by the Django development server, and which must be uploaded to the CDN.

Use Bootstrap Whenever You Can

The "new" datatracker uses Twitter Bootstrap for the UI.

Get familiar with https://getbootstrap.com/getting-started/ and use those UI elements, CSS classes, etc. instead of cooking up your own.

Some ground rules:

  • Think hard before tweaking the bootstrap CSS, it will make it harder to upgrade to future releases.
  • No <style> tags in the HTML! Put CSS into the "morecss" block of a template instead.
  • CSS that is used by multiple templates goes into static/css/ietf.css or a new CSS file.
  • Javascript that is only used on one template goes into the "js" block of that template.
  • Javascript that is used by multiple templates goes into static/js/ietf.js or a new js file.
  • Every template includes jquery, so write jquery code and not plain Javascript. It's shorter and often faster.
  • Avoid CSS, HTML styling or Javascript in the python code!

Serving Static Files via CDN

Production Mode

If resources served over a CDN and/or with a high max-age don't have different URLs for different versions, then any component upgrade which is accompanied by a change in template functionality will have a long transition time during which the new pages are served with old components, with possible breakage. We want to avoid this.

The intention is that after a release has been checked out, but before it is deployed, the standard django collectstatic management command will be run, resulting in all static files being collected from their working directory location and placed in an appropriate location for serving via CDN. This location will have the datatracker release version as part of its URL, so that after the deployment of a new release, the CDN will be forced to fetch the appropriate static files for that release.

An important part of this is to set up the STATIC_ROOT and STATIC_URL settings appropriately. In 6.4.0, the setting is as follows in production mode:

STATIC_URL = "https://www.ietf.org/lib/dt/%s/"%__version__
STATIC_ROOT = CDN_ROOT + "/a/www/www6s/lib/dt/%s/"%__version__

The result is that all static files collected via the collectstatic command will be placed in a location served via CDN, with the release version being part of the URL.

Development Mode

In development mode, STATIC_URL is set to /static/, and Django's staticfiles infrastructure makes the static files available under that local URL root (unless you set settings.SERVE_CDN_FILES_LOCALLY_IN_DEV_MODE to False). It is not necessary to actually populate the static/ directory by running collectstatic in order for static files to be served when running ietf/manage.py runserver -- the runserver command has extra support for finding and serving static files without running collectstatic.

In order to work backwards from a file served in development mode to the location from which it is served, the mapping is as follows:

Development URL Working copy location
localhost:8000/static/ietf/* ietf/static/ietf/*
localhost:8000/static/secr/* ietf/secr/static/secr/*

Handling of External Javascript and CSS Components

In order to make it easy to keep track of and upgrade external components, these are now handled by a tool called npm via the configuration in package.json.

Handling of Internal Static Files

Previous to this release, internal static files were located under static/, mixed together with the external components. They are now located under ietf/static/ietf/ and ietf/secr/static/secr, and will be collected for serving via CDN by the collectstatic command. Any static files associated with a particular app will be handled the same way (which means that all admin/ static files automatically will be handled correctly, too).

Changes to Template Files

In order to make the template files refer to the correct versioned CDN URL (as given by the STATIC_URL root) all references to static files in the templates have been updated to use the static template tag when referring to static files. This will automatically result in both serving static files from the right place in development mode, and referring to the correct versioned URL in production mode and the simpler /static/ URLs in development mode.

Deployment

During deployment, it is now necessary to run the management command:

ietf/manage.py collectstatic

before activating a new release.