Skip to main content
DjangoKit Log In

Installation

Using the DjangoKit CLI to generate a project, as documented in the Get Started doc, is generally recommended, but you can install DjangoKit manually if you need to or if you want to try it out in an existing project.

Steps

  • Install Python >= 3.10
  • Create a project directory with the necessary files
  • Add the required settings
  • Create a virtualenv for the project
  • Install DjangoKit packages into the virtualenv
  • Install your project into the virtualenv

Project Directory

Create a directory for your project. Within this directory, create some directories and files:

  • A src subdirectory.
  • A src/<package> for the package containing your code.
  • A src/<package>/models subdirectory for your Django models.
  • A src/<package>/routes subdirectory for your DjangoKit routes.
  • pyproject.toml to specify your Python project details and dependencies. If you use uv, you can create this with uv init. You can also use any other dependency manager.
  • settings.public.toml and settings.development.toml for your project configuration.

As an example, let's assume you're creating a blog. Your project directory should end up looking like this:

blog/
    src/
        blog/
            __init__.py
            models/
                __init__.py   ← export all model classes from here
                post.py       ← Post model
            routes/
                _slug/
                   page.html  ← blog post
                _init__.py
                app.html
                layout.html
                page.html     ← blog post listing
    pyproject.toml
    settings.development.toml
    settings.public.toml

NOTE: manage.py, settings.py, and urls.py aren't needed in a typical DjangoKit project.

Settings

Add the following settings to settings.public.toml, replacing <package> with the name of your package (e.g., blog from the example above):

[djangokit]
package = "<package>"

Add the following settings to settings.development.toml:

[django]
DEBUG = true
SECRET_KEY = "Generate a random key for use in development ONLY"

Python Dependencies

For each of these, run uv add <name> (or the equivalent for whichever dependency manager you're using).

  • Django
  • org-djangokit-core
  • org-djangokit-cli