Skip to content

Repository files navigation

Django local test

A test project for local Django development, originally by @MHLut.

This project is not suitable for production purposes!

What is this for?

This is a development project for Django, the web framework for perfectionists with deadlines.

Follows the guidelines as described in A simple approach to running Django Core locally.

Installation

Warning: These instructions are crude and not a tutorial: I assume you already know how to use the tools described.

Requirements

Setup

  1. Pick a directory in which to store the Django core and test projects side-by-side.
  2. Clone your fork of Django core; the directory name should be django.
  3. Clone the Django local test project.
  4. Navigate to the local test project directory.
  5. Copy the .env file from .env.example; adjust .env where needed.
  6. Reload (source) the environment variables from .env.
  7. Create a virtual environment and activate it.
  8. Install the dependencies from requirements.txt.

The commands are something like this:

git clone <fork>
git clone git@github.com:MHLut/django-local-test.git
cd django-local-test
cp .env.example .env
source .env
python3 -m venv venv
pip install -r requirements.txt

Note: If you want to use the project in a language other than the default one, run the compilemessages command first per Localization.

Localization

The app supports translations through Django's built-in internationalization and localization tools.

Translation files live in src/locale.

To update the translation files, use makemessages:

src/manage.py makemessages --no-wrap --no-obsolete --ignore venv --all

Note: Replace --all with --locale and a language code if you only want to update one language.

After editing, recompile the binary files using compilemessages:

src/manage.py compilemessages --ignore venv

Alternatively, you can use a translation tool like Poedit, which automatically compiles the binary files.

Note: The project does not store the compiled messages in the code repository, meaning you must use compilemessages to generate them on first use.

See also

About

A test project for Django Core development; not for production use!

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages