|
| 1 | +--- |
| 2 | +title : Rocket Django PRO - Premium Starter |
| 3 | +sidebar_label: Rocket Django PRO |
| 4 | +--- |
| 5 | + |
| 6 | +# [Rocket Django PRO](https://appseed.us/product/rocket-pro/django/) |
| 7 | + |
| 8 | +<SubHeading>Premium Django Starter styled with Tailwind and Flowbite.</SubHeading> |
| 9 | + |
| 10 | +Premium Django Starter that incorporates a few modern technologies provided out-of-the-box, at a production-ready level. |
| 11 | +[Rocket PRO](https://appseed.us/product/rocket-pro/django) comes with API (via DRF), Charts, server-side DataTable, Celery for async tasks processing, and Docker support. |
| 12 | + |
| 13 | +- 👉 [Rocket Django PRO](https://rocket-django-pro.onrender.com/) - `LIVE Demo` |
| 14 | +- 👉 [Rocket Django PRO](https://appseed.us/product/rocket-pro/django/) - `Product Page` |
| 15 | + |
| 16 | + |
| 17 | + |
| 18 | +<br /> |
| 19 | + |
| 20 | +## Features |
| 21 | + |
| 22 | +The codebase is shipped with basic features that are usually implemented in most of the projects: |
| 23 | + |
| 24 | +- Up-to-date Dependencies |
| 25 | +- Tailwind/Flowbite Integration via WebPack |
| 26 | +- `Extended User Model` |
| 27 | +- API via `DRF` |
| 28 | +- Charts |
| 29 | +- Charts via React |
| 30 | +- Enhanced DataTables |
| 31 | +- Media Files Manager |
| 32 | +- `Celery` (async processing) |
| 33 | +- Docker |
| 34 | + |
| 35 | +<br /> |
| 36 | + |
| 37 | +## System Requirements |
| 38 | + |
| 39 | +- [Python3](https://www.python.org) - the programming language used to code the app |
| 40 | +- [GIT](https://git-scm.com) - used to clone the source code from the Github repository |
| 41 | +- [NodeJS](https://nodejs.org/) v18.20.0 or above (for Tailwind set up) |
| 42 | +- [Docker](https://www.docker.com/) - a popular virtualization software |
| 43 | + |
| 44 | +<br /> |
| 45 | + |
| 46 | +## Download Sources |
| 47 | + |
| 48 | +> 👉 Unzip sources or clone the private repository (requires a [purchase](https://appseed.us/product/rocket-pro/django/)) |
| 49 | +
|
| 50 | +```bash |
| 51 | +$ unzip rocket-django-pro.zip |
| 52 | +// OR |
| 53 | +$ git clone https://github.com/app-generator/priv-rocket-django-pro.git |
| 54 | +$ cd rocket-django-pro |
| 55 | +``` |
| 56 | + |
| 57 | +Once the sources are available in the local filesystem, we can start the project using `Docker` or `manual build`. |
| 58 | + |
| 59 | +<br /> |
| 60 | + |
| 61 | +## Start with `Docker` |
| 62 | + |
| 63 | +```bash |
| 64 | +# Optional (kill all existing containers) |
| 65 | +$ docker container kill $(docker ps -q) ; docker container rm $(docker ps -a -q) ; docker network prune -f |
| 66 | +# Start the APP |
| 67 | +$ docker-compose up --build |
| 68 | +``` |
| 69 | + |
| 70 | +Visit `http://localhost:5085` in your browser. The app should be up & running. The starter comes with two default users: |
| 71 | + |
| 72 | +- Ordinary user: `test` / `[email protected]` / `Pass12__` (the password) |
| 73 | +- Django SuperUser (admin): `admin` / `[email protected]` / `Pass12__` (the password) |
| 74 | + |
| 75 | +Once authenticated with the above credentials, the sidebar shows different items. |
| 76 | + |
| 77 | +<br /> |
| 78 | + |
| 79 | +## Manual Build |
| 80 | + |
| 81 | +> 👉 Create `.env` from `env.sample` |
| 82 | +
|
| 83 | +```env |
| 84 | +DEBUG=False |
| 85 | +
|
| 86 | +SECRET_KEY=<STRONG_KEY_HERE> |
| 87 | +``` |
| 88 | + |
| 89 | +> 👉 Install **Django** modules via `VENV` |
| 90 | +
|
| 91 | +```bash |
| 92 | +$ virtualenv env |
| 93 | +$ source env/bin/activate |
| 94 | +$ pip install -r requirements.txt |
| 95 | +``` |
| 96 | + |
| 97 | +> 👉 Install **Tailwind/Flowbite** (another terminal) |
| 98 | +
|
| 99 | +Tested with **Node** `v18.20.0` (use at least this version or above) |
| 100 | + |
| 101 | +```bash |
| 102 | +$ npm install |
| 103 | +$ npm run dev |
| 104 | +$ npx tailwindcss -i ./static/assets/style.css -o ./static/dist/css/output.css --watch # DEVELOPMENT (LIVE reload) |
| 105 | +$ npx tailwindcss -i ./static/assets/style.css -o ./static/dist/css/output.css # PRODUCTION |
| 106 | +``` |
| 107 | + |
| 108 | +> 👉 Migrate DB |
| 109 | +
|
| 110 | +```bash |
| 111 | +$ python manage.py makemigrations |
| 112 | +$ python manage.py migrate |
| 113 | +``` |
| 114 | + |
| 115 | +> 👉 `Create Superuser` & Start the [Rocket Django](https://appseed.us/product/rocket/django/) Starter |
| 116 | +
|
| 117 | +```bash |
| 118 | +$ python manage.py createsuperuser # create the admin |
| 119 | +$ python manage.py runserver # start the project |
| 120 | +``` |
| 121 | + |
| 122 | +At this point, we can start using the starter. |
| 123 | + |
| 124 | +<br /> |
| 125 | + |
| 126 | +## Use MySql |
| 127 | + |
| 128 | +By default, the starter uses SQLite for persistence. In order to use MySql, here are the steps: |
| 129 | + |
| 130 | +- Start the MySql Server |
| 131 | +- Create a new DataBase |
| 132 | +- Create a new user with full privileges over the database |
| 133 | +- Install the MySql Python Driver (used by Django to connect) |
| 134 | + - `$ pip install mysqlclient` |
| 135 | +- Edit the `.env` with the SQL Driver Information & DB Credentials |
| 136 | + |
| 137 | +```env |
| 138 | +
|
| 139 | +DB_ENGINE=mysql |
| 140 | +DB_HOST=localhost |
| 141 | +DB_NAME=<DB_NAME_HERE> |
| 142 | +DB_USERNAME=<DB_USER_HERE> |
| 143 | +DB_PASS=<DB_PASS_HERE> |
| 144 | +DB_PORT=3306 |
| 145 | +
|
| 146 | +``` |
| 147 | + |
| 148 | +Once the above settings are done, run the migration & create tables: |
| 149 | + |
| 150 | +```bash |
| 151 | +$ python manage.py makemigrations |
| 152 | +$ python manage.py migrate |
| 153 | +``` |
| 154 | + |
| 155 | +<br /> |
| 156 | + |
| 157 | +## Production Build |
| 158 | + |
| 159 | +To use the starter in production mode, here are the steps: |
| 160 | + |
| 161 | +- Set **DEBUG=False** in `.env` |
| 162 | +- Execute `collectstatic` command |
| 163 | + - `$ python manage.py collectstatic --no-input` |
| 164 | + |
| 165 | +<br /> |
| 166 | + |
| 167 | +## **Deploy on Render** |
| 168 | + |
| 169 | +- Create a Blueprint instance |
| 170 | + - Go to https://dashboard.render.com/blueprints this link. |
| 171 | +- Click `New Blueprint Instance` button. |
| 172 | +- Connect the `repo` that you want to deploy. |
| 173 | +- Fill the `Service Group Name` and click on the `Update Existing Resources` button. |
| 174 | +- Edit the Environment and [specify the PYTHON_VERSION](https://render.com/docs/python-version) |
| 175 | + - Version `3.11.5` was used for **[this deployment](https://rocket-django.onrender.com/)** |
| 176 | +- After that, your deployment will start automatically. |
| 177 | + |
| 178 | +At this point, the product should be LIVE. |
| 179 | + |
| 180 | +<br /> |
| 181 | + |
| 182 | +## Codebase |
| 183 | + |
| 184 | +```bash |
| 185 | +< PROJECT ROOT > |
| 186 | + | |
| 187 | + |-- core/ # Project Settings |
| 188 | + | |-- settings.py |
| 189 | + | |-- wsgi.py |
| 190 | + | |-- urls.py |
| 191 | + | |
| 192 | + |-- home/ # Presentation app |
| 193 | + | |-- views.py # serve the HOMEpage |
| 194 | + | |-- urls.py |
| 195 | + | |-- models.py |
| 196 | + | |
| 197 | + |-- apps/ # Utility Apps |
| 198 | + | |-- common/ # defines models & helpers |
| 199 | + | | |-- models.py |
| 200 | + | | |-- util.py |
| 201 | + | |-- users # Handles Authentication |
| 202 | + | |-- api # DRF managed API |
| 203 | + | |-- charts # Showcase Different Charts |
| 204 | + | |-- tables # Implements DataTables |
| 205 | + | |-- tasks # Celery, async processing |
| 206 | + | |
| 207 | + |-- templates/ # UI templates |
| 208 | + |-- static/ # Tailwind/Flowbite |
| 209 | + | |-- src/ # |
| 210 | + | |-- input.css # CSS Styling |
| 211 | + | |
| 212 | + |-- Dockerfile # Docker |
| 213 | + |-- docker-compose.yml # Docker |
| 214 | + | |
| 215 | + |-- render.yml # CI/CD for Render |
| 216 | + |-- build.sh # CI/CD for Render |
| 217 | + | |
| 218 | + |-- manage.py # Django Entry-Point |
| 219 | + |-- requirements.txt # dependencies |
| 220 | + |-- .env # ENV File |
| 221 | + | |
| 222 | + |-- ************************************************* |
| 223 | +``` |
| 224 | + |
| 225 | +<br /> |
| 226 | + |
| 227 | +## ✅ Resources |
| 228 | + |
| 229 | +- 👉 Access [AppSeed](https://appseed.us/) for more starters and support |
| 230 | +- 👉 [Deploy Projects on Aws, Azure and DO](https://www.docs.deploypro.dev/) via **DeployPRO** |
| 231 | +- 👉 Create landing pages with [Simpllo, an open-source site builder](https://www.simpllo.com/) |
| 232 | +- 👉 Build apps with [Django App Generator](https://app-generator.dev/django/) (free service) |
0 commit comments