A simple bill of materials app built using the django web framework.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
bom
django_bom.egg-info
.gitignore
LICENSE
MANIFEST.in
README.md
manage.py
release.sh
requrements.txt
setup.py
update-local.sh

README.md

BOM

BOM is a simple Django app to manage a bill of materials. It is a level up from an excel spreadsheet including an indented bill of materials, octopart price match, and more. It is written in Python 3.7 and Django 2.1.1.

An example of the app in use can be seen here.

If you already have a django project, you can skip to Add Django Bom To Your App, otherwise Start From Scratch.

Table of contents

Start From Scratch

  1. To start from scratch we recommend setting up a virtual environment
virtualenv -p python3 mysite
cd mysite
source bin/activate
  1. From here install django, and set up your project.
pip install django==2.1.1
django-admin startproject mysite
cd mysite
python manage.py migrate
python manage.py createsuperuser # make a user for your development environment
  1. Continue on to Add Django Bom To Your App.

Add Django Bom To Your App

django-bom is a reusable django application. If you don't already have a django project, you can follow some quick steps below to get up and running, or read about creating your first django app here. Note that django-bom currently supports python 2.7.

pip install django-bom
  1. Add "bom" to your INSTALLED_APPS setting like this::
INSTALLED_APPS = [
    ...
    'bom',
]
  1. Update your URLconf in your project urls.py like this::
url(r'^bom/', include('bom.urls')),

And don't forget to import include:

from django.conf.urls import include, url
  1. Update your settings.py to add the bom context processor 'bom.context_processors.bom_config', to your TEMPLATES variable, and create a new empty dictionary BOM_CONFIG.
TEMPLATES = [
    {
        ...
        'OPTIONS': {
            'context_processors': [
                ...
                'bom.context_processors.bom_config',
            ],
        },
    },
]

and

BOM_CONFIG = {}
  1. Run python manage.py migrate to create the bom models.

  2. Start the development server python manage.py runserver and visit http://127.0.0.1:8000/admin/ to manage the bom (you'll need the Admin app enabled).

  3. Visit http://127.0.0.1:8000/bom/ to begin.

Customize Base Template

The base template can be customized to your pleasing. Just add the following configuration to your settings.py:

BOM_CONFIG = {
    'base_template': 'base.html',
}

where base.html is your base template.

Octopart Integration

For part matching, make sure to add your Octopart api key to your settings.py in the BOM_CONFIG dictionary.

BOM_CONFIG = {
    'octopart_api_key': 'supersecretkey',
}

You can get an Octopart api key here.