Refactoring a Django App as a Stand-Alone Module

From Littledamien Wiki
Revision as of 20:21, 16 February 2016 by Video8 (talk | contribs)
Jump to navigation Jump to search

Overview

This page catalogs the workflow involved in taking an app that is part of a Django project and refactoring it as a stand-alone module.

Reusable Django Packages/Apps contains an overview of the principles of creating stand-alone Django modules

Workflow

- project_root_dir
    |-- app_dir
    |     |-- tests/
    |     |-- __init__.py
    |     |-- admin.py
    |     |-- app.py
    |     `-- models.py
    |-- .gitignore
    |-- LICENSE
    |-- MANIFEST.IN
    |-- README.md
    `-- setup.py
  • Move project files to directory outside Django project, e.g. ~/develop/django/apps
  • Add package config files
    • LICENSE
    • MANIFEST.in
    • README.md
    • setup.py
  • Delete migrations directory
  • Add project properties in the app directory