Skip to content

Historic: Sprint: IETF75Sprint

Robert Sparks edited this page Apr 26, 2023 · 1 revision

IETF75 Code Sprint

There will be a code sprint in Stockholm on July 25 (the Saturday before IETF 75).

If you plan to participate, please sign up on the IETF75SprintSignUp page.

There is a jabber room at codesprint@conference.resiprocate.org.

This sprint will be in the City Conference Center room 503-504 (IETF terminal room) from 9:30 to 18:00.

We have the mailing list "codesprints@ietf.org" to help with coordination and for use during the event. Please make sure you're subscribed before the event starts. More info on the list is available at https://www.ietf.org/mailman/listinfo/codesprints.

See you in Stockholm!

This sprint's plan

  • Replace any remaining perl/mysql using scripts run by cron with django based equivalents. (See IETF73SprintLegacyScriptsDocumentation).

  • Once all legacy perl scripts are made superfluous, start refactoring and new coding against the new database schema

  • Begin the migration to from Django 0.96 to Django 1.0

    • In ipr/new.py there is a call "forms.form_for_model" which needs to be changed to use the Djano 1.0 approach. Remove "CustomForm" and change template to look like old formatting. (in progress ietf 75 Jelte rev 1580/1581)
  • Update links outdated/broken by IETF reorg (ietf 75 chris rev 1587,1590,1593)

  • Add support for loading new IETF design header / footer from files specified in settings.py

Prerequisites

  • A working knowledge of python and/or web design

  • Learn the basic concepts of Django 0.96, e.g., work through the excellent tutorial. (You may choose to start with the 1.0 tutorial, but be sure to spend the time to learn the 0.96/1.0 differences - most of the code you will encounter at this sprint will still be based on 0.96).

  • Review the porting guide at http://docs.djangoproject.com/en/dev/releases/1.0-porting-guide/

  • Bring a laptop with python (2.4 or 2.5), django 0.96, subversion and mysql (4.x is ok, 5.x is better) installed, and be ready to check out a branch of the IETF web site from the tools svn server. (Watch for a list discussion on how to have Django 0.96 and 1.0 installed on the same machine). Note that some Unix distributions such as FreeBSD 7.1 only have ports for django 1.0; see http://media.djangoproject.com/releases/0.96/Django-0.96.3.tar.gz to get the source tarball.

Reference information

Each sprint participant will get their own branch to work in. You'll do something like this to check it out:

svn co http://svn.tools.ietf.org/svn/tools/ietfdb/sprint/75/yourname

MySQL Configuration

DATABASE_ENGINE   = 'mysql'
DATABASE_NAME     = 'ietf'
DATABASE_USER     = 'ietf'
DATABASE_PASSWORD = 'ietf'
DATABASE_HOST     = 'merlot.tools.ietf.org'
DATABASE_PORT     = ''

Create a file named settings_local.py in the ietf directory of your SVN checkout and put the above lines in it. (There will already be a settings.py file in that directory that will import settings_local for you).

Initial Setup

You can test that everything is ready go do by changing into the IETF directory and issuing a simple admin command:

python manage.py sql ipr

You should see a series of database table definitions:

BEGIN;
CREATE TABLE `ipr_updates` (
    `id` integer NOT NULL PRIMARY KEY,
    `ipr_id` integer NOT NULL,
etc.

If you get an error like this:

Error: Can't find the file 'settings.py' in the directory containing './manage.py'. It appears you've customized things.
You'll have to run django-admin.py, passing it your settings module.
(If the file settings.py does indeed exist, it's causing an ImportError somehow.)

It's probably because you don't have a local settings file. You can get started by creating a basically empty one:

echo '#' > settings_local.py

Old Perl Scripts

The old perl scripts that we'll be can be read at:

http://trac.tools.ietf.org/tools/ietfdb/browser/branch/legacy

Or, if you'd prefer to check them out into a local tree, you can use subversion:

http://svn.tools.ietf.org/svn/tools/ietfdb/branch/legacy/

You won't be working in that branch -- it's only to get the old scripts so you can read them.

Setting up your environment to run django scripts from the command line

You'll need a couple of environment variables:

export PYTHONPATH=(path to your branch - the ietf directory should be in what you put here)
export DJANGO_SETTINGS_MODULE=ietf.settings
Clone this wiki locally