aaronsgithub / litdjango

Literate programming dialect of Django using nbdev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Getting Started

This is a work in progress…

Start a project

litdjango startproject <projectname>

The default project template mostly resembles the default django project template.

A regular Django project created with django-admin startproject <project-name> will have the following directory structure:

<project-name>
├── manage.py
└── <project-name>
    ├── __init__.py
    ├── asgi.py
    ├── settings.py
    ├── urls.py
    └── wsgi.py

By default manage.py, asgi.py, wsgi.py and settings.py files all hardcode the path of the settings module which is dependent on the <project-name>.

This is unfortunate because if you decide to change the name of your project (which might not be set in stone at the beginning of a project), and you want the name change to reflected in the code then you have to update each of these references.

For this reason we have removed this reference to the project name by renaming the inner directory to config, and updated the path to the settings file in each file accordingly:

testproject/
├── nbs
│   ├── config
│   │   ├── asgi.ipynb
│   │   ├── settings.ipynb
│   │   ├── urls.ipynb
│   │   └── wsgi.ipynb
│   └── manage.ipynb
└── <project-name>
    # build your django project by editing nbs
    # a build command will output regular python modules in this directory

About

Literate programming dialect of Django using nbdev


Languages

Language:Jupyter Notebook 53.8%Language:Python 44.6%Language:CSS 1.6%