Metadata-Version: 2.4
Name: cppdjango
Version: 6.0.7.post1
Summary: A C++ port of Django 6.0.7 with native ORM and request-processing paths.
Keywords: django,cpp,c++,web framework,orm,postgresql
Author: Django Software Foundation and individual contributors, cppdjango contributors
License-Expression: BSD-3-Clause
License-File: AUTHORS
License-File: LICENSE
License-File: LICENSE.python
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Web Environment
Classifier: Framework :: Django
Classifier: Intended Audience :: Developers
Classifier: Operating System :: MacOS
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: C++
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
Classifier: Topic :: Internet :: WWW/HTTP :: WSGI
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Project-URL: Homepage, https://django.goblinreactor.com/
Project-URL: Documentation, https://django.goblinreactor.com/#install
Project-URL: Benchmarks, https://django.goblinreactor.com/#numbers
Project-URL: Source, https://github.com/adamdeprince/cppdjango
Project-URL: Tracker, https://github.com/adamdeprince/cppdjango/issues
Requires-Python: >=3.12
Requires-Dist: asgiref>=3.9.1
Requires-Dist: sqlparse>=0.5.0
Requires-Dist: tzdata; sys_platform == "win32"
Provides-Extra: argon2
Requires-Dist: argon2-cffi>=23.1.0; extra == "argon2"
Provides-Extra: bcrypt
Requires-Dist: bcrypt>=4.1.1; extra == "bcrypt"
Provides-Extra: native-dev
Requires-Dist: scikit-build-core>=0.11; extra == "native-dev"
Requires-Dist: nanobind>=2.13; extra == "native-dev"
Requires-Dist: pytest>=8.0; extra == "native-dev"
Description-Content-Type: text/x-rst

=========
cppdjango
=========

cppdjango is an independent C++ port of Django 6.0.7. It keeps Django's
familiar ``django`` import namespace and public APIs while moving selected ORM,
request-processing, template, URL, parsing, and utility paths into a C++26
extension. Unsupported values and query shapes conservatively replay through
the compatible Python implementation.

The current PostgreSQL benchmark measures 81.4% less framework-side ORM CPU,
or 436% faster ORM-only CPU performance, across an equal-weight point-select,
ordered ``IN`` select, and point-update suite. PostgreSQL and the shared
cursor/psycopg floor are excluded from that claim. Raw measurements and the
methodology are published at https://django.goblinreactor.com/artifacts/.

Install
========

Use a fresh virtual environment. The PyPI distribution is named
``cppdjango``, but the Python package remains ``django``::

    python3 -m venv .venv
    . .venv/bin/activate
    python -m pip install --upgrade pip
    python -m pip install cppdjango==6.0.7.post1

cppdjango replaces upstream Django. Do not install the ``Django`` and
``cppdjango`` distributions in the same environment because both own the
``django`` import namespace. When converting an existing environment, remove
upstream Django first::

    python -m pip uninstall -y Django
    python -m pip install cppdjango==6.0.7.post1

The package contains native code. If no compatible wheel is available, pip
builds it from source and needs:

* Python 3.12 or newer;
* CMake 3.26 or newer and Ninja or Make;
* a C++ compiler with the C++26 features used by cppdjango;
* OpenSSL and zlib development headers and libraries.

For example, on macOS with Homebrew::

    brew install cmake ninja openssl@3
    CMAKE_PREFIX_PATH="$(brew --prefix openssl@3)" \
      python -m pip install cppdjango==6.0.7.post1

On a Debian-family Linux system, install CMake, Ninja, OpenSSL and zlib
development packages plus a recent compiler. Package names vary by release;
one typical setup is::

    sudo apt install cmake ninja-build g++-15 libssl-dev zlib1g-dev
    CXX=g++-15 python -m pip install cppdjango==6.0.7.post1

Verify both the distribution version and native extension::

    python -c "import django; from django import native; print(django.__version__, native.version(), native.compiler())"

Both versions should report ``6.0.7.post1`` and the compiler should not report
``none``. ``DJANGO_NATIVE=0`` disables the extension for comparison and
diagnostics; it is not needed for ordinary use.

PostgreSQL
==========

Database drivers remain separate, just as they are in Django. For PostgreSQL::

    python -m pip install "psycopg[binary]>=3.1"

Third-party packages that declare a dependency on the distribution name
``Django`` cannot express that ``cppdjango`` supplies the same import API.
Installing such a package may cause pip to add upstream Django. Install and
review those dependencies deliberately, and confirm with::

    python -m pip list | grep -i django

Only ``cppdjango`` should own the ``django`` package in that environment.

Source installation
===================

For development or a source checkout::

    git clone https://github.com/adamdeprince/cppdjango.git
    cd cppdjango
    python3 -m venv .venv
    . .venv/bin/activate
    python -m pip install --upgrade pip
    python -m pip install -e ".[native-dev]"

Full installation notes are in ``docs/installation.md``. Upstream Django's
documentation remains applicable unless a cppdjango document says otherwise:
https://docs.djangoproject.com/en/6.0/.

License and trademark
=====================

cppdjango retains Django's BSD license and attribution. ``Django`` is a
trademark of the Django Software Foundation. cppdjango is independent and is
not endorsed by the Django Software Foundation.
