Soft Design PRO#

Premium Django Starter enhanced with OAuth Github, Extended User Profiles, Self-Deletion option, and Docker Support. Creative-Tim provides the Soft UI Design, the premium version

πŸ‘‰ New to App-Generator? Join our 10k+ Community using GitHub One-Click SignIN.

Features#

  • Simple, Easy-to-Extend codebase

  • Soft Design UI PRO Integration

  • Bootstrap 5 Styling

  • Session-based Authentication

  • OAuth for Github

  • Extended User Profiles

  • DB Persistence: SQLite/MySql/PostgreSQL

  • Docker

  • CI/CD integration for Render

Premium Django starter built on top of Bootstrap 5 and Soft Design PRO, a pixel-perfect design from Creative-Tim.

Prerequisites#

A few tools need to be installed in the system to use the starter efficiently:

  • Python

  • A modern code editor like VsCode, or Sublime

  • (optional) GIT - for pulling the source code and work under a version control system

  • (optional) Docker for isolated execution

  • (optional) DB Servers: - MySql - PostgreSQL

Download Source Code#

Access the product page and complete the purchase. Unpack the ZIP archive and folow these steps:

unzip django-soft-ui-design-pro.zip
cd django-soft-ui-design-pro

Once the source code is unzipped, the next step is to start it and use provided features.

Export GITHUB_TOKEN in the environment#

App-Generator provides the value during purchase. This is required because the project has a private REPO dependency: github.com/app-generator/priv-django-theme-soft-pro

GITHUB_TOKEN export for different operating systems#
$ export GITHUB_TOKEN='TOKEN_HERE'  # for Linux, Mac
$ set GITHUB_TOKEN='TOKEN_HERE'     # Windows CMD
$ $env:GITHUB_TOKEN = 'TOKEN_HERE'  # Windows powerShell

Codebase#

The project is coded using a simple and intuitive structure presented below:

Project Files#
< Project ROOT >
    |
    |
    |-- core/
    |    |-- settings.py                  # Project Configuration
    |    |-- urls.py                      # Project Routing
    |
    |-- home/
    |    |-- views.py                     # APP Views
    |    |-- urls.py                      # APP Routing
    |    |-- models.py                    # APP Models
    |    |-- tests.py                     # Tests
    |    |-- templates/                   # Theme Customisation
    |         |-- includes                #
    |              |-- custom-footer.py   # Custom Footer
    |
    |-- requirements.txt                  # Project Dependencies
    |
    |-- env.sample                        # ENV Configuration (default values)
    |-- manage.py                         # Start the app - Django default start script

Manual Build#

It’s best to use a Python Virtual Environment for installing the project dependencies. You can use the following code to create the virtual environment

virtualenv env

To activate the environment execute env\Scripts\activate.bat for Windows or source env/bin/activate on Linux-based operating systems.

Having the VENV active, we can proceed and install the project dependencies:

pip install -r requirements.txt

Environment#

The starter loads the environment variables from .env file. Here are the critical ones:

  • DEBUG: set by default to False (development mode)

  • SECRET_KEY: a random value used by Django to secure sensitive information like passwords and cookie information

  • Database Credentials: DB_ENGINE, DB_USERNAME, DB_PASS, DB_HOST, DB_PORT, DB_NAME
    • if detected, the database is switched automatically from the default SQLite to the specified DBMS

Setting up the Database#

By default, the application uses SQLite for persistence. In order to use MySql / PostgreSQL, you’ll need to install the Python driver(s):

pip install mysqlclient # for MySql
# OR
pip install psycopg2    # for PostgreSQL

To connect the application with the database, you’ll need to fill in the credentials int the .env file and run the migrations.

.env#
DB_ENGINE=mysql
# OR
DB_ENGINE=postgresql

# DB credentials below
DB_HOST=localhost
DB_NAME=<DB_NAME_HERE>
DB_USERNAME=<DB_USER_HERE>
DB_PASS=<DB_PASS_HERE>
DB_PORT=3306

Use the following commands to set up the database:

python manage.py makemigrations
python manage.py migrate

Running the project#

The following command starts the project using Django development server:

python manage.py runserver          # Starts on default PORT 8000
python manage.py runserver 8999     # Starts on PORT 8999 (custom port)

By default Django starts on port 8000 but this can be easily changed by adding the PORT number as argument. At this point, the app runs at http://127.0.0.1:8000/

Premium Django starter built on top of Bootstrap 5 and Soft Design PRO, a pixel-perfect design from Creative-Tim.

Create Users#

By default, the app redirects guest users to authenticate. In order to access the private pages, follow this set up:

  • Start the app

  • Access the registration page and create a new user: - http://127.0.0.1:8000/register/

  • Access the sign in page and authenticate - http://127.0.0.1:8000/login/

The superusers can be easily created via the CLI:

python manage.py createsuperuser