Movatterモバイル変換


[0]ホーム

URL:


Wayback Machine
9 captures
20 Aug 2017 - 15 Apr 2025
SepSEPApr
Previous capture30Next capture
202020222024
success
fail
COLLECTED BY
TIMESTAMPS
loading
The Wayback Machine - https://web.archive.org/web/20220930020158/https://github.com/django/code.djangoproject.com
Skip to content
Sign up

Configuration for Django's Trac instance (code.djangoproject.com)

License

django/code.djangoproject.com

main
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.

Configuration for Django's Trac instance (code.djangoproject.com)

Local install

Getting a local Trac install running is a bit tricky. Here are a few tricksthat can help:

  • Follow the installation instructions in djangoproject/README.rst (especiallythe database creation).
  • Usetrac-admin ./trac-env/ permission add anonymous TRAC_ADMINto give all permissions to the anonymous user.
  • Use the commandtracd --port 9000 -s trac-env to serve Trac locally.
  • If you've modified thetrackhack.scss file, usesassc scss/trachacks.scss trac-env/htdocs/css/trachacks.css -s compressedto compile it to CSS.

Using Docker

  • Install Docker

  • pip install docker-compose

  • docker-compose up --build

  • Follow instructions above to create/load the DB, grant permissions, create theconfig, etc. For example:

    docker-compose up --buildexport DATABASE_URL=postgres://code.djangoproject:secret@db/code.djangoprojectdocker-compose exec -T db psql $DATABASE_URL < ../djangoproject.com/tracdb/trac.sqldocker-compose exec trac /venv/bin/trac-admin /code/trac-env/ permission add anonymous TRAC_ADMIN

Using Podman

It may be possible to use Podman for local development to more closely simulateproduction. The above Docker instructions should work for Podman as well,however, be aware thatpodman-compose is not as well battle-tested asdocker-compose (e.g., it may require pruning or forcefully stopping acontainer before it will rebuild properly).

How to port the CSS from djangoproject.com

Assumes that code.djangoproject.com and djangoproject.com are stored in thesame directory (adjust paths if needed).

  1. Copy the generated CSS:cp ../djangoproject.com/static/css/*.css trac-env/htdocs/css/
  2. Copy _utils.scss (needed by trackahacks.scss):cp ../djangoproject.com/static/scss/_utils.scss scss/
  3. Copy the javascript directory:cp -rT ../djangoproject.com/static/js trac-env/htdocs/js
  4. Compile trackhacks.scss:make compile-scss

How to recreate trac.sql after upgrading Trac

Start with a clean slate:

docker-compose downsh -c 'cd ../djangoproject.com && git checkout tracdb/trac.sql'

Bring up database and Trac via docker-compose:

docker-compose up --build -dexport DATABASE_URL=postgres://code.djangoproject:secret@db/code.djangoprojectdocker-compose exec -T db psql $DATABASE_URL < ../djangoproject.com/tracdb/trac.sqldocker-compose exec trac /venv/bin/trac-admin /code/trac-env/ upgradedocker-compose exec db pg_dump --column-inserts -d $DATABASE_URL > ../djangoproject.com/tracdb/trac.sql

Note:

  • There's no need to run thetrac-admin ... wiki upgrade command
  • Be careful with changes thattrac-admin ... upgrade makes totrac.ini. We usually don't want them.
  • Review the diff carefully to make sure no unexpected database changesare inadvertently included.

About

Configuration for Django's Trac instance (code.djangoproject.com)

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

[8]ページ先頭

©2009-2025 Movatter.jp