This README explains how to set up and run the Dental Clinic API project on Windows and Linux / macOS for development and quick local testing.
Quick summary: This is a Django REST Framework project with multiple apps (accounts, appointments, billing, medical, operations, payroll, pharmacy). It exposes OpenAPI docs (Swagger / Redoc) and a JSON schema. The project ships with
manage.pyand arequirements.txtfor dependencies.
- Project overview
- Prerequisites
- Setup (Linux / macOS)
- Setup (Windows - PowerShell)
- Database options (dev vs production)
- Running migrations & creating a superuser
- Running the dev server
- API docs & importing into Postman
- Static & media files (development)
- Useful management commands
- Troubleshooting & tips
- Multiple Django apps:
accounts,appointments,billing,medical,operations,payroll,pharmacy. - API base:
http://localhost:8000/api/with interactive docs at/api/docs/and/api/redoc/.
- Python 3.10+ (or the interpreter used by the project)
- git
- pip
- For production or MySQL setup: MySQL/MariaDB server and
mysqlclientinstalled (or usepsycopg2for Postgres if preferred)
Open a terminal in the project root (where manage.py is):
# create & activate venv
python3 -m venv venv
source venv/bin/activate
# upgrade pip and install requirements
python -m pip install --upgrade pip
pip install -r requirements.txt
# set environment variables (example)
export DJANGO_SETTINGS_MODULE=core.settings
export SECRET_KEY='your-secret-key'
export DEBUG=True # set False in production
# if using MySQL, configure DATABASES in settings and export DB credentialsThen run migrations and create a user:
python manage.py migrate
python manage.py createsuperuser
python manage.py collectstatic --noinput # optional (for static files)Start the dev server:
python manage.py runserver 0.0.0.0:8000Open PowerShell in the project root:
# create & activate venv
py -3 -m venv venv
venv\Scripts\Activate.ps1
# upgrade pip and install
python -m pip install --upgrade pip
pip install -r requirements.txt
# set env vars (temporary for current PS session)
$env:DJANGO_SETTINGS_MODULE = 'core.settings'
$env:SECRET_KEY = 'your-secret-key'
$env:DEBUG = 'True' # 'False' in production
# then migrate and create superuser
python manage.py migrate
python manage.py createsuperuser
python manage.py collectstatic --noinput
# run dev server
python manage.py runserver 0.0.0.0:8000Note: In cmd.exe use
venv\\Scripts\\activate.bat. In PowerShell you might need to adjust the execution policy to allow the activate script:Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass.
- For quick local development the project can use the included
db.sqlite3(no extra config). - For production or multi-developer environments use MySQL/MariaDB or Postgres and update
DATABASESinsettings.py. Ensuremysqlclient(or other DB adapter) is installed and the DB server is reachable.
- The project is configured to use
djangorestframework-simplejwtfor JWT authentication. Example settings are in the repo and configure token lifetimes, algorithms, and auth classes.
- Open the interactive Swagger UI:
http://localhost:8000/api/docs/. - Schema (OpenAPI JSON):
http://localhost:8000/api/schema/.
You can import the schema into Postman to auto-generate a collection:
- In Postman click Import → Link and paste
http://localhost:8000/api/schema/(or upload the downloadedopenapi.json). - Postman creates a Collection with requests based on the OpenAPI spec.
python manage.py migrate— Apply migrationspython manage.py createsuperuser— Create admin userpython manage.py runserver— Run dev serverpython manage.py collectstatic— Collect static filespython manage.py loaddata <fixture>— Load fixtures
- If
pip install -r requirements.txtfails formysqlclient, install system-level dependencies first (e.g.,sudo apt install default-libmysqlclient-devon Debian/Ubuntu). On Windows use prebuilt wheels or use MariaDB C connector. - If static files 404 in production: ensure
collectstaticran and nginx/your server serves theSTATIC_ROOTpath. - If media uploads fail: check
MEDIA_ROOTand file permissions.
- Root
manage.pyandcore/urls.pycontain the main routing and documentation routes (/api/docs/,/api/schema/,/api/redoc/). - Apps live under the project root (
accounts/,appointments/,billing/, ...).
- Add license information here if needed.
- For questions: contact the maintainer.
Thanks for using this project — edit this README to add project-specific deploy notes.