|
8 | 8 |
|
9 | 9 | > Free product - **Django Dashboard** starter project - Features: |
10 | 10 |
|
| 11 | +- Up-to-date [dependencies](./requirements.txt): **Django 3.2.6 LTS** |
| 12 | +- [SCSS compilation](#recompile-css) via **Gulp** |
11 | 13 | - UI Kit: **Material Dashboard** (Free Version) provided by **[Creative-Tim](https://www.creative-tim.com/)** |
12 | 14 | - Django Codebase - provided by **[AppSeed](https://appseed.us/)** |
13 | 15 | - UI-Ready app, SQLite Database, Django Native ORM |
@@ -88,56 +90,133 @@ Within the download you'll find the following directories and files: |
88 | 90 | ```bash |
89 | 91 | < PROJECT ROOT > |
90 | 92 | | |
91 | | - |-- core/ # Implements app logic and serve the static assets |
92 | | - | |-- settings.py # Django app bootstrapper |
| 93 | + |-- core/ # Implements app configuration |
| 94 | + | |-- settings.py # Defines Global Settings |
93 | 95 | | |-- wsgi.py # Start the app in production |
94 | 96 | | |-- urls.py # Define URLs served by all apps/nodes |
| 97 | + | |
| 98 | + |-- apps/ |
| 99 | + | | |
| 100 | + | |-- home/ # A simple app that serve HTML files |
| 101 | + | | |-- views.py # Serve HTML pages for authenticated users |
| 102 | + | | |-- urls.py # Define some super simple routes |
| 103 | + | | |
| 104 | + | |-- authentication/ # Handles auth routes (login and register) |
| 105 | + | | |-- urls.py # Define authentication routes |
| 106 | + | | |-- views.py # Handles login and registration |
| 107 | + | | |-- forms.py # Define auth forms (login and register) |
95 | 108 | | | |
96 | 109 | | |-- static/ |
97 | 110 | | | |-- <css, JS, images> # CSS files, Javascripts files |
98 | 111 | | | |
99 | 112 | | |-- templates/ # Templates used to render pages |
100 | | - | | |
101 | 113 | | |-- includes/ # HTML chunks and components |
102 | 114 | | | |-- navigation.html # Top menu component |
103 | 115 | | | |-- sidebar.html # Sidebar component |
104 | 116 | | | |-- footer.html # App Footer |
105 | 117 | | | |-- scripts.html # Scripts common to all pages |
106 | 118 | | | |
107 | | - | |-- layouts/ # Master pages |
108 | | - | | |-- base-fullscreen.html # Used by Authentication pages |
109 | | - | | |-- base.html # Used by common pages |
| 119 | + | |-- layouts/ # Master pages |
| 120 | + | | |-- base-fullscreen.html # Used by Authentication pages |
| 121 | + | | |-- base.html # Used by common pages |
110 | 122 | | | |
111 | | - | |-- accounts/ # Authentication pages |
112 | | - | | |-- login.html # Login page |
113 | | - | | |-- register.html # Register page |
| 123 | + | |-- accounts/ # Authentication pages |
| 124 | + | | |-- login.html # Login page |
| 125 | + | | |-- register.html # Register page |
114 | 126 | | | |
115 | | - | index.html # The default page |
116 | | - | page-404.html # Error 404 page |
117 | | - | page-500.html # Error 404 page |
118 | | - | *.html # All other HTML pages |
119 | | - | |
120 | | - |-- authentication/ # Handles auth routes (login and register) |
121 | | - | | |
122 | | - | |-- urls.py # Define authentication routes |
123 | | - | |-- views.py # Handles login and registration |
124 | | - | |-- forms.py # Define auth forms |
125 | | - | |
126 | | - |-- app/ # A simple app that serve HTML files |
127 | | - | | |
128 | | - | |-- views.py # Serve HTML pages for authenticated users |
129 | | - | |-- urls.py # Define some super simple routes |
| 127 | + | |-- home/ # UI Kit Pages |
| 128 | + | |-- index.html # Index page |
| 129 | + | |-- 404-page.html # 404 page |
| 130 | + | |-- *.html # All other pages |
130 | 131 | | |
131 | | - |-- requirements.txt # Development modules - SQLite storage |
| 132 | + |-- requirements.txt # Development modules - SQLite storage |
132 | 133 | | |
133 | | - |-- .env # Inject Configuration via Environment |
134 | | - |-- manage.py # Start the app - Django default start script |
| 134 | + |-- .env # Inject Configuration via Environment |
| 135 | + |-- manage.py # Start the app - Django default start script |
135 | 136 | | |
136 | 137 | |-- ************************************************************************ |
137 | 138 | ``` |
138 | 139 |
|
139 | 140 | <br /> |
140 | 141 |
|
| 142 | +> The bootstrap flow |
| 143 | +
|
| 144 | +- Django bootstrapper `manage.py` uses `core/settings.py` as the main configuration file |
| 145 | +- `core/settings.py` loads the app magic from `.env` file |
| 146 | +- Redirect the guest users to Login page |
| 147 | +- Unlock the pages served by *app* node for authenticated users |
| 148 | + |
| 149 | +<br /> |
| 150 | + |
| 151 | +## Recompile CSS |
| 152 | + |
| 153 | +To recompile SCSS files, follow this setup: |
| 154 | + |
| 155 | +<br /> |
| 156 | + |
| 157 | +**Step #1** - Install tools |
| 158 | + |
| 159 | +- [NodeJS](https://nodejs.org/en/) 12.x or higher |
| 160 | +- [Gulp](https://gulpjs.com/) - globally |
| 161 | + - `npm install -g gulp-cli` |
| 162 | +- [Yarn](https://yarnpkg.com/) (optional) |
| 163 | + |
| 164 | +<br /> |
| 165 | + |
| 166 | +**Step #2** - Change the working directory to `assets` folder |
| 167 | + |
| 168 | +```bash |
| 169 | +$ cd apps/static/assets |
| 170 | +``` |
| 171 | + |
| 172 | +<br /> |
| 173 | + |
| 174 | +**Step #3** - Install modules (this will create a classic `node_modules` directory) |
| 175 | + |
| 176 | +```bash |
| 177 | +$ npm install |
| 178 | +// OR |
| 179 | +$ yarn |
| 180 | +``` |
| 181 | + |
| 182 | +<br /> |
| 183 | + |
| 184 | +**Step #4** - Edit & Recompile SCSS files |
| 185 | + |
| 186 | +```bash |
| 187 | +$ gulp scss |
| 188 | +``` |
| 189 | + |
| 190 | +The generated file is saved in `static/assets/css` directory. |
| 191 | + |
| 192 | +<br /> |
| 193 | + |
| 194 | +## Deployment |
| 195 | + |
| 196 | +The app is provided with a basic configuration to be executed in [Docker](https://www.docker.com/), [Gunicorn](https://gunicorn.org/), and [Waitress](https://docs.pylonsproject.org/projects/waitress/en/stable/). |
| 197 | + |
| 198 | +### [Docker](https://www.docker.com/) execution |
| 199 | +--- |
| 200 | + |
| 201 | +The application can be easily executed in a docker container. The steps: |
| 202 | + |
| 203 | +> Get the code |
| 204 | +
|
| 205 | +```bash |
| 206 | +$ git clone https://github.com/app-generator/django-dashboard-material.git |
| 207 | +$ cd django-dashboard-material |
| 208 | +``` |
| 209 | + |
| 210 | +> Start the app in Docker |
| 211 | +
|
| 212 | +```bash |
| 213 | +$ sudo docker-compose pull && sudo docker-compose build && sudo docker-compose up -d |
| 214 | +``` |
| 215 | + |
| 216 | +Visit `http://localhost:85` in your browser. The app should be up & running. |
| 217 | + |
| 218 | +<br /> |
| 219 | + |
141 | 220 | ## Browser Support |
142 | 221 |
|
143 | 222 | At present, we officially aim to support the last two versions of the following browsers: |
|
0 commit comments