Skip to main content

A reusable Django app for a phone directory system.

Project description

django_phonedir

A reusable Django app for a phone directory system.

Tested and known to work with Django 5.2 and newer. Tested with Python 3.12 and newer.

Requirements

  • Python >= 3.12
  • daisyUI (only for provided templates)
  • Django >= 5.2
  • django-phonenumber-field >= 8.4.0
  • phonenumberslite >= 9.0.26

Installation

Install via pip.

pip install django-phonedir

Add to Django settings INSTALLED_APPS like so...

INSTALLED_APPS = [
    ...
    "django-phonedir",
    ...
]

URL Paths

By default, there are certain URL paths that are provided to help get you started. The built-in URL paths and templates can be utilized by adding django_phonedir.urls to your main list of urlpatterns in a urls.py file like so...

from django.urls import include, path

urlspatterns = [
    ...
    path("", include("django_phonedir.urls")),
    ...
]

You don't have to use these URL paths and associated templates. Below is a listing of the paths with the associated views and template names.

  • Path: departments
    • View: DepartmentListView
    • Template Name: department_list
    • Template File: department_listing.html
  • Path: department/<slug:short_name>/
    • View: DepartmentDetailView
    • Template Name: department_detail
    • Template File: department_detail.html
  • Path: search
    • View: SearchResultsView
    • Template Name: search_results
    • Template File: search_contact_results.html

Templates

The templates that are provided require daisyUI version 5.5 or newer, Tailwind version 4 or newer, and Font Awesome version 7.0.1 or newer. You can copy the below and add to your base template file to get started quickly.

<!-- DaisyUI + Tailwind CSS -->
<link href="https://cdn.jsdelivr.net/npm/daisyui@5"
      rel="stylesheet"
      type="text/css" />
<script src="https://cdn.jsdelivr.net/npm/@tailwindcss/browser@4"></script>
<!-- Font Awesome for Icons -->
<link rel="stylesheet"
      href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/7.0.1/css/all.min.css">
<style>

Models

To use a model, import from django_phonedir.models like so...

from django_phonedir.models import Department, FaxNumber, Contact

Below is a listing of each model, their attributes, and description for each attribute..

Department

  • name : Name of the department.
  • short_name : Short name that is used in the URL.
  • supervisor : Foreign key that points to a user (typically the supervisor).

FaxNumber

  • department : Foreign key that points to a Department model.
  • description : Description of the fax number.
  • phone : PhoneNumberField
  • location: Location of fax number.

Contact

  • department : Foreign key that points to a Department model.
  • first_name : First name.
  • last_name : Last name.
  • title : Job title.
  • extension : Phone extension.
  • location : location the user.
  • phone : PhoneNumberField (can be blank.)

Development

This project is under active development by myself.

I will develop better documentation at a later date.

Setup

Use pipenv for managing the package requirements for development.

pipenv install --dev

Testing

Tests can be run using the command below.

pipenv run test

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django_phonedir-0.3.3.tar.gz (27.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_phonedir-0.3.3-py3-none-any.whl (23.0 kB view details)

Uploaded Python 3

File details

Details for the file django_phonedir-0.3.3.tar.gz.

File metadata

  • Download URL: django_phonedir-0.3.3.tar.gz
  • Upload date:
  • Size: 27.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for django_phonedir-0.3.3.tar.gz
Algorithm Hash digest
SHA256 f800128a7a81c81880c7419073a96f81c4bbbc7b4ea70b30ac866a7ddaf0a6c2
MD5 731096587274ed4c26e33dc1fe5a1374
BLAKE2b-256 0cdf28b8c25d69f2f5d1778df762dc7138cf0d44a8cd654b657aa05676ef6b82

See more details on using hashes here.

File details

Details for the file django_phonedir-0.3.3-py3-none-any.whl.

File metadata

File hashes

Hashes for django_phonedir-0.3.3-py3-none-any.whl
Algorithm Hash digest
SHA256 4837512b470bccadc939db3b4caaabeb9d44cc349191b88320635cf3beee3e6a
MD5 c972ce3d266089733bafb21a704d6db4
BLAKE2b-256 e3ffafc57db26880032c9f75cdc2293b604a3825bace37dfa597b1ff8b6c2e43

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page