Skip to main content

This is a namespace package for extra Django packages. Feel free to use it.

Project description

This is just a namespace package for Django-related projects. Feel free to use it.

Does Django even support namespace packages?

It currently doesn’t but you can patch it like so:

import django.core.management

def django_core_management__find_management_module(app_name):
    """
    Determines the path to the management module for the given app_name,
    without actually importing the application or the management module.

    Raises ImportError if the management module cannot be found for any reason.

    Supports namespace packages.
    """
    import sys
    import os.path

    parts = app_name.split('.')
    parts.append('management')

    management_module = __import__(app_name + '.management', fromlist=parts)
    path = management_module.__file__

    if path.endswith(('__init__.py', '__init__.pyc')):
        path = os.path.split(path)[0]

    return path

# PATCH: a more generic find_management_module that supports namespace
# packages.
# COMPATIBILITY: Django 1.1.0 - 1.3.0
django.core.management.find_management_module = \
    django_core_management__find_management_module

Authors

Glued together by Łukasz Langa.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dj-0.0.tar.gz (2.5 kB view details)

Uploaded Source

File details

Details for the file dj-0.0.tar.gz.

File metadata

  • Download URL: dj-0.0.tar.gz
  • Upload date:
  • Size: 2.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for dj-0.0.tar.gz
Algorithm Hash digest
SHA256 81f26bf8c98fcc178cdf0e93fee9cf614745c5a823e1891aea82551db267c9d7
MD5 415fd8b31c894112463915e3625db93d
BLAKE2b-256 cfbc672967395404e6857dbbe99ded622b3aedbee48a946063440e149d69b1aa

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page