Django rewritten to Golang.
This is a rewrite of the Django framework in Golang.
The goal is to provide a similar experience to Django, but with the performance of Golang.
At the core this is meant to be a web framework, but it also includes sub-packages to create a CMS-like experience.
Any database logic can be implemented with the queries
subpackage, providing an experience similar to
the Django ORM.
Documentation needs to be updated.
You can run an example blog- application by cloning the repository and executing:
mkdir ./.private/blogapp
go run ./examples/blogapp makemigrations
go run ./examples/blogapp migrate
go run ./examples/blogapp createuser -s # -s to make superuser, -i to make inactive user
go run ./examples/blogapp
# Navigate to: http://127.0.0.1:8080/admin/login
# Explore!
Latest version: v1.7.0
The package is easily installed with go get
.
go get github.com/Nigel2392/go-django@v1.7.0
The CLI can optionally be installed with go install
.
This will provide some useful utilities to help you get started, like creating a new project, app or Dockerfile.
go install github.com/Nigel2392/go-django/cmd/go-django@v1.7.0
Or to install the SQLC plugin to auto- generate SQL queries and go-django definitions from your SQL database.
go install github.com/Nigel2392/go-django/cmd/go-django-definitions@v1.7.0
- Using the CLI
- Configuring your server
- Creating an app
- Setting up Routing
- Working with context
- Working with the Filesystem
- Rendering Your Templates
- Easily rendering Views (WIP)
- Creating Forms
- Information about models
- Paginating your data
- Cache Management
- Caching your Views
- Sending Emails
- Setting up Logging
- Setting up and calling Hooks
- Serving your Staticfiles
- Working with permissions
- Creating Management Commands
GO-Django is tested to work on the following databases:
But more tests / databases will be added over time.
- SQLite through mattn/go-sqlite3
- MySQL through go-sql-driver/mysql
- Local MYSQL with dolthub/go-mysql-server through go-sql-driver/mysql (used internally for testing)
- MariaDB through a custom driver (with returning support, custom driver - use "mariadb" in
drivers.Open(...)
) - Postgres through jackc/pgx
- go-django-queries - A library to help you create SQL queries specialized (and only useful) for go-django models.
- Block application:
- Javascript for structblock
- Javascript for listblock
- (maybe) Javascript for fieldblock