Django Cookie-Cutter - Simple Theme-able Generator
Tags: webdev, django, cookiecutter, appseed
Published: 2021-09-04 09:50:47

---
title: Django Cookie-Cutter - Simple Theme-able Generator
published: true
description: A simple way to build Django projects using less manual work: Django Cookie-Cutter, a theme-able tool.
tags: webdev, django, cookiecutter, appseed
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lyk0ehkiyr9ugifaxshg.jpg
canonical_url: https://blog.appseed.us/django-cookie-cutter-generator/
---
Hello Coders!

This article presets **[Django Cookie-Cutter](https://blog.appseed.us/django-cookie-cutter-generator/)** as a simple way to build a **Django** project with less manual coding and the possibility to customize a few things like UI design and database type (SQLite, MySql, or PostgreSQL). For newcomers, **CookieCutter** is a command-line utility that creates projects from project templates and **Django** is a leading web framework built by experts using a batteries-included concept.

> *Thanks for reading!* - Content provided by **[App Generator](https://appseed.us/)**.

---

> What's in the box

Using the **Django Cookie-Cutter** tool any developer can generate simple Django projects like the ones listed below with customized design and database backends plus minor things like project name and README instructions.

- (free) [Django Soft UI](https://appseed.us/product/django-soft-ui-dashboard) - simple Django dashboard with Soft UI design
- (free) [Django Volt](https://appseed.us/admin-dashboards/django-dashboard-volt) - a modern dashboard with Bootstrap 5 design
- (free) [Django Datta Able](https://appseed.us/admin-dashboards/django-datta-able) - open-source colorful dashboard

---

![Django Cookie-Cutter - Sample Projects.](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/w5krd3m435ipok2pefik.png)

---

## How to use it

To use this simple generator a [minimal programming kit](https://docs.appseed.us/content/tutorials/minimal-programming-kit) should be installed in the workstation starting with Python3 and GIT:

- **Python** - a modern script language used for many types of projects
- **GIT** - a command-line tool used to download sources from Github
- A modern editor like **VSCode**, **Atom**, or even **Notepad++**

Once we have all the tools properly installed, we can move on and build a Django project.

---

**Step #1** - Install dependencies (cookie-cutter and GitPython) 

```bash
$ pip install cookiecutter
$ pip install GitPython
```

The above command uses PIP, the official package manager for Python, to install required modules globally in the system. The recommended way to install packages is to use a virtual environment that isolates the installation as shown below:

```bash
$ # Virtualenv modules installation (Unix based systems)
$ virtualenv env
$ source env/bin/activate
$
$ # Install modules
$ pip install cookiecutter
$ pip install GitPython
```

---

**Step #2** - Generate the project

```bash
$ cookiecutter https://github.com/app-generator/cookiecutter-django.git
```

---

**Step #3** - Customize the future project

Most of the commands provide a default value selectable by an `ENTER`.

```bash
>>> # Project Name Option 
>>> project_name [Django Seed project]: django_volt

>>> # Project Slug is the directory name
>>> project_slug [django_volt]:

>>> # Project Description: saved in the README file 
>>> description [A simple Django project]: My Simple Django Project

>>> # Project Author: saved in the README file   
>>> author_name []: Sm0ke

>>> # Author Email: saved in the README file   
>>> email [bill@microsoft.com]:

>>> Project Version: saved in the README file
>>> version [0.0.1]:

>>> UI Kit: (Volt default option)
>>> Select theme:
1 - volt
2 - soft-ui
3 - datta-able

>>> Database: (SQLite default option) 
Select database:
1 - sqlite3
2 - mysql
3 - postgresql

>>> Database Credentials: Used to configure the connection
>>> database_name [appseed_django]: db_name
>>> database_user [appseed_user]: db_user
>>> database_pass [Pass1234]: SuperS3cret_Hgdv
```

In the end, the UI is downloaded from a public repository and injected into the codebase.  Let's open the generated directory `django_volt` and visualize the codebase.

---

![Django Cookie-Cutter - Generated Codebase](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/metqfqa7r2301am2rs6e.png)

---
 
**Item #1** is the project README customized to explain how to build the project according to the selected options (database, project name...).

**Item #2** - applications that provide basic features like authentication, forms validation, and UI Theme integration.

---

The next logical step is to follow the build instructions presented in the README file and start the generated project:

> **Step #1** - Create a virtual environment

```bash
$ # Virtualenv modules installation (Unix based systems)
$ virtualenv env
$ source env/bin/activate
```

---

> **Step #2** - Install project dependencies

```bash
$ # Install modules
$ pip3 install -r requirements.txt
```

---

> **Step #3** - Set up the database (create tables)

```bash
$ python manage.py makemigrations
$ python manage.py migrate
```

---

> **Step #4** - Start the generated Django project

```bash
$ # Start the application (development mode)
$ python manage.py runserver
$
$ # Access the web app in the browser: http://127.0.0.1:8000/
```

The project should look like the original [Volt Dashboard](https://appseed.us/admin-dashboards/django-dashboard-volt) **(demo link)** and the log in page is shown by default for guest users. Once we create a new user and Sign IN, the access to the private pages is unlocked.

---

![Django Cookie-Cutter - Login Page](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/97ahr94yq8r1nga3d4m8.png)

---

> Django Cookie-Cutter Volt - Dashboard Page

![Django Cookie-Cutter - Dashboard Page.](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/b9goyn6ybq764gotlcg5.png)

---

In the same way, we can build more Django projects but using different UI kits without coding anything.

---

### Soft UI - A modern Bootstrap 5 design

Designed for those who like bold elements and beautiful websites, Soft UI Dashboard is ready to help you create stunning websites and web apps. Soft UI Dashboard is built with over 70 frontend individual elements, like buttons, inputs, navbars, nav tabs, cards, or alerts, giving you the freedom of choosing and combining.  

---

> [Django Soft UI Dashboard](https://django-soft-ui-dashboard.appseed-srv1.com/) - LIVE Demo

---

![Django Cookie-Cutter - Soft UI.](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/05uo4gwzvs8e7pcbzv47.png)
 
---

### Datta Able - a colorful dashboard

[Datta Able](https://appseed.us/admin-dashboards/django-dashboard-dattaable-pro) Bootstrap Lite is the most stylized Bootstrap 4 Lite Admin Template, around all other Lite/Free admin templates in the market. It comes with high feature-rich pages and components with fully developer-centric code. 

---

> [Datta Able Django](https://django-datta-able.appseed-srv1.com/) - LIVE deployment

---

![Django Cookie-Cutter - Datta Able.](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/baqys3tp10ydnutya9su.png)
 
---

The **Django Cookie-Cutter** tool will be updated with more options (deployment), UI Themes, and more featured bundled in the codebase.

- New themes: CoreUI, AdminLTE (popular open-source templates)
- Deployment: AWS, Google Cloud, HEROKU, Docker
- Modules: Data tables, Charts, Stripe Payments

The full list with future evolutions can be found here: [Django Codebase SPECS](https://github.com/app-generator/boilerplate-code-django-dashboard/issues/14).

---

> **Thanks for reading!** For more resources, please access:

- More [Django Dashboards](https://appseed.us/admin-dashboards/django) built with modern UI kits
- [Open-source Admin Dashboards](https://appseed.us/admin-dashboards/open-source) - curated index provided by AppSeed
- Free [React Dashboards](https://dev.to/sm0ke/react-dashboards-open-source-apps-1c7j) - a popular article published on Dev.to