Skips-Scramble / stochastic-finances

Stochastic modeling of future financials
Other
1 stars 0 forks source link

AppStack Django Starter

Thanks for downloading AppStack. This project features a batteries-included Django starter project for AppStack. It is based on DjangoX.

Features

Table of Contents

Installation

AppStack Django can be installed via Pip, Pipenv, or Docker depending upon your setup. To start, clone the repo to your local computer and change into the proper directory.

Pip

$ pip install -r requirements.txt
$ python manage.py migrate
$ python manage.py createsuperuser
$ python manage.py runserver
# Load the site at http://127.0.0.1:8000

Pipenv

$ pipenv install
$ pipenv shell
$ python manage.py migrate
$ python manage.py createsuperuser
$ python manage.py runserver
# Load the site at http://127.0.0.1:8000

Docker

$ docker build .
$ docker-compose up -d
$ docker-compose exec web python manage.py migrate
$ docker-compose exec web python manage.py createsuperuser
# Load the site at http://127.0.0.1:8000

For Docker, the INTERNAL_IPS configuration in config/settings.py must be updated to the following:

# config/settings.py
# django-debug-toolbar
import socket
hostname, _, ips = socket.gethostbyname_ex(socket.gethostname())
INTERNAL_IPS = [ip[:-1] + "1" for ip in ips]

Setup

# Run Migrations
$ python manage.py migrate

# Create a Superuser
$ python manage.py createsuperuser

# Confirm everything is working:
$ python manage.py runserver

# Load the site at http://127.0.0.1:8000

General Information

To get the VS Code instance going using poetry:

Poetry

Add packages

Ruff

We are using ruff as our formatter and linter

Djlint

I don't think ruff lints and formats django html files, so we use djlint Make sure you are in a poetry shell, or prefix with poetry run