Skip to content

ibraheem4/django-base-template

Repository files navigation

NOTE: This app runs on SSL, so the default commands (e.g. pnpm start) will serve via HTTPS on localhost.

Prerequisites

Before running this application, ensure that you have the following installed:

Installation

  1. Clone the repository or download the source code.

  2. Open a terminal or command prompt and navigate to the project directory.

  3. Run pnpm install to install the project dependencies.

  4. Create a virtual environment:

    python -m venv .venv
    
  5. Activate the virtual environment:

    On macOS and Linux:

    source .venv/bin/activate
    

    On Windows:

    .venv\Scripts\activate
    

Quickstart

Update Environment Variables

Include .env file to set environment variables. .env.example is included as an example.

Update FIXME

Find and replace any instances of FIXME.

Run startup scripts

sh scripts/ssl-script.sh && \ # Only on initial setup
sh scripts/startup-script.sh
  1. Generate SSL scripts
  2. Install Python packages
  3. Migrate databases
  4. Collect static files
  5. Load fixtures
  6. Run the server

Verify project is serving on localhost.

Running / Development

Setup Database

Generate a SQLite database (django_base_template/django_base_template/db.sqlite3) and load initial fixture data.

  • pnpm migrate:run-syncdb
  • pnpm load-fixtures

Collect static files

Run the collectstatic management command.

  • pnpm collectstatic

Visit your API at https://localhost:8000/api

Testing

Run some tests.

  • pnpm test
  • pnpm coverage:html

Open htmlcov/index.html in the web browser.

Linting

Perform linting.

  • pnpm lint

Git commit template

git config commit.template .gitmessage

Further Reading / Useful Links

About

Django API app with Django REST framework

Topics

Resources

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published