Django implementation of the Autonumber service.
This is a reimplementation of the Autonumber service from the Ruby on Rails app.
There are two ways to install this application:
- uv (for the recommended installation)
- pyenv, which will manages the shims for
pipandpython
First, get the code by cloning the repository:
git clone https://github.com/umd-lib/autonumber-django.git
cd autonumber-djangoWith uv you can install python like so:
uv python install 3.14.0With pyenv you use
pyenv install 3.14.0-
Create a virtual environment:
uv venv
-
Install the dependencies:
uv sync --extra dev
This uses the standard tools built into Python.
-
Create a virtual environment:
python -m venv .venv --prompt autonumber
-
Activate the environment:
source .venv/bin/activate -
Install the project and its dependencies:
pip install -e ".[dev]"
Once you have installed the project using either method, you need to set up the database and run the server.
-
Run the database migrations:
uv run src/manage.py migrate
-
(Optional) Create a superuser: This allows you to log into the Django admin interface at
/admin/.uv run src/manage.py createsuperuser
-
Run the development server:
uv run src/manage.py runserver
-
Visit
http://127.0.0.1:8000in your web browser.
-
Run the database migrations:
python src/manage.py migrate
-
(Optional) Create a superuser: This allows you to log into the Django admin interface at
/admin/.python src/manage.py createsuperuser
-
Run the development server:
python src/manage.py runserver
-
Visit http://localhost:8000 in your web browser.
This project uses pytest and pytest-django.
-
Run the test suite: With uv
uv run pytest
With pyenv
pytest
NOTE With pyenv you may need to
source .venv/bin/activateagain after installing the optional dependencies, so that the pytest shim gets properly updated in your terminal session.