|
1 | 1 | --- |
2 | | -title: Django SB Admin - Open-Source Starter |
3 | | -sidebar_label: Django SB Admin |
| 2 | +title: Django SB-Admin - Open-Source Starter |
| 3 | +sidebar_label: Django SB-Admin |
4 | 4 | --- |
5 | 5 |
|
6 | | -# [Django SB Admin](https://appseed.us/product/sb-admin/django/) |
| 6 | +# [Django SB-Admin](https://appseed.us/product/sb-admin/django/) |
7 | 7 |
|
8 | | -<SubHeading>Open-source Django Dashboard generated by AppSeed on top of SB Admin design (free version)</SubHeading> |
| 8 | +<SubHeading>Open-source Django Starter coded on top Sb-Admin design.</SubHeading> |
9 | 9 |
|
10 | | -**SB Admin** is a beautifully designed admin template featuring a fine selection of useful Bootstrap components and elements. This Dashboard is coming with pre-built examples, so the development process is seamless, switching from our pages to the real website is very easy to be done. |
| 10 | +Django Admin Dashboard generated by the AppSeed platform on top of **Sb-Admin** design, an iconic free dahsboard template. |
11 | 11 |
|
12 | | -> Features |
| 12 | +- 👉 [SB-Admin Django](https://appseed.us/product/sb-admin/django/) - `Product page` |
| 13 | +- 👉 [SB-Admin Django](https://django-sb-admin.appseed-srv1.com/) - `LIVE Demo` |
13 | 14 |
|
14 | | -- Codebase - [Django Dashboard Boilerplate](../../boilerplate-code/starters/django-dashboard.mdx) |
15 | | -- UI Kit: **SB Admin** (free version) |
16 | | -- SQLite Database, Django Native ORM |
17 | | -- Session-Based Authentication, Forms validation |
18 | | -- Deployment scripts: Docker, Gunicorn/Nginx |
| 15 | +:::info [**v1.0.4**](https://github.com/app-generator/django-sb-admin/releases) - release date `2022-06-01` |
| 16 | +::: |
19 | 17 |
|
20 | | -> Links |
| 18 | +<br /> |
21 | 19 |
|
22 | | -- [SB Admin Django](https://appseed.us/product/sb-admin/django/) - product page |
23 | | -- [SB Admin Django](https://github.com/app-generator/django-dashboard-sb-admin) - source code |
24 | | -- [SB Admin Django](https://django-sb-admin.appseed-srv1.com/) - LIVE Demo |
| 20 | +> **Features** |
25 | 21 |
|
26 | | -> [Support](https://appseed.us/support) (Email and LIVE on Discord) for **registered** [**AppSeed**](https://appseed.us/) **users**. |
| 22 | +- ✅ UI Kit: `SB-Admin` |
| 23 | +- ✅ SQLite Database, Django Native ORM |
| 24 | +- ✅ Session-Based Authentication, Forms validation |
| 25 | +- ✅ Deployment scripts: Docker, Gunicorn/Nginx |
27 | 26 |
|
28 | | -### |
| 27 | + |
29 | 28 |
|
30 | | -### What is Django |
| 29 | +<br /> |
31 | 30 |
|
32 | | -Django is a high-level Python Web framework that encourages rapid development and clean, pragmatic design. Built by experienced developers, it takes care of much of the hassle of Web development, so you can focus on writing your app without needing to reinvent the wheel. It’s free and open source. |
| 31 | +## Environment |
33 | 32 |
|
34 | | -> Read more about [Django Framework](../../content/what-is/django.mdx) |
| 33 | +To use the starter, [Python3](https://www.python.org) should be installed properly in the workstation. |
| 34 | +If you are not sure if Python is installed, please open a terminal and type `python --version`. Here is the full list with dependencies and tools required to build the app: |
35 | 35 |
|
36 | | -### How to use the App |
| 36 | +- [Python3](https://www.python.org) - the programming language used to code the app |
| 37 | +- [GIT](https://git-scm.com) - used to clone the source code from the Github repository |
| 38 | +- Basic development tools (g++ compiler, python development libraries ..etc) used by Python to compile the app dependencies in your environment. |
| 39 | +- (Optional) `Docker` - a popular virtualization software |
37 | 40 |
|
38 | | -- [Set up the environment](../../boilerplate-code/starters/django-dashboard.mdx#environment-1) - prepare your workstation for **Django** |
39 | | -- [Compile the sources](../../boilerplate-code/starters/django-dashboard.mdx#build-the-app-1) - start this **Django** app in the local environment |
40 | | -- [App Codebase](../../boilerplate-code/starters/django-dashboard.mdx#app-codebase) - how the project files are organized |
41 | | -- [App Configuration](../../boilerplate-code/starters/django-dashboard.mdx#app-configuration) - how to configure this **Django** application |
| 41 | +<br /> |
42 | 42 |
|
43 | | -### SB Admin UI |
| 43 | +## Start in `Docker`` |
44 | 44 |
|
45 | | -**SB Admin** is a free, open-source, Bootstrap 4 based admin theme perfect for quickly creating dashboards and web applications. It's modern design style with subtle shadows and a card-based layout could be described as flat material and is inspired by the principles of material design along with a simple, attractive color system. |
| 45 | +> 👉 **Step 1** - Download the [source code](https://github.com/app-generator/django-sb-admin) from the GH repository (using `GIT`) |
46 | 46 |
|
47 | | -- [SB Admin](https://startbootstrap.com/template/sb-admin) - product page |
48 | | -- [SB Admin](https://github.com/startbootstrap/startbootstrap-sb-admin) - source code (Github) |
| 47 | +```bash |
| 48 | +$ # Get the code |
| 49 | +$ git clone https://github.com/app-generator/django-sb-admin.git |
| 50 | +$ cd django-sb-admin |
| 51 | +``` |
49 | 52 |
|
50 | | - |
| 53 | +> 👉 **Step 2** - Start the APP in `Docker` |
| 54 | +
|
| 55 | +```bash |
| 56 | +$ docker-compose up --build |
| 57 | +``` |
| 58 | + |
| 59 | +Visit `http://localhost:5085` in your browser. The app should be up & running. |
| 60 | + |
| 61 | +<br /> |
| 62 | + |
| 63 | +## Manual Build |
| 64 | + |
| 65 | +> Download the [source code](https://github.com/app-generator/django-sb-admin) from the GH repository (using `GIT`) |
| 66 | +
|
| 67 | +```bash |
| 68 | +$ # Get the code |
| 69 | +$ git clone https://github.com/app-generator/django-sb-admin.git |
| 70 | +$ cd django-sb-admin |
| 71 | +``` |
| 72 | + |
| 73 | + |
| 74 | +### 👉 Set Up for `Unix`, `MacOS` |
| 75 | + |
| 76 | +> Install modules via `VENV` |
| 77 | +
|
| 78 | +```bash |
| 79 | +$ virtualenv env |
| 80 | +$ source env/bin/activate |
| 81 | +$ pip3 install -r requirements.txt |
| 82 | +``` |
| 83 | + |
| 84 | +> Set Up Database |
| 85 | +
|
| 86 | +```bash |
| 87 | +$ python manage.py makemigrations |
| 88 | +$ python manage.py migrate |
| 89 | +``` |
| 90 | + |
| 91 | +> Start the app |
| 92 | +
|
| 93 | +```bash |
| 94 | +$ python manage.py runserver |
| 95 | +``` |
| 96 | + |
| 97 | +At this point, the app runs at `http://127.0.0.1:8000/`. |
| 98 | + |
| 99 | + |
| 100 | +### 👉 Set Up for `Windows` |
| 101 | + |
| 102 | +> Install modules via `VENV` (windows) |
| 103 | +
|
| 104 | +``` |
| 105 | +$ virtualenv env |
| 106 | +$ .\env\Scripts\activate |
| 107 | +$ pip3 install -r requirements.txt |
| 108 | +``` |
| 109 | + |
| 110 | +> Set Up Database |
| 111 | +
|
| 112 | +```bash |
| 113 | +$ python manage.py makemigrations |
| 114 | +$ python manage.py migrate |
| 115 | +``` |
| 116 | + |
| 117 | +> Start the app |
| 118 | +
|
| 119 | +```bash |
| 120 | +$ python manage.py runserver |
| 121 | +``` |
| 122 | + |
| 123 | +At this point, the app runs at `http://127.0.0.1:8000/`. |
| 124 | + |
| 125 | +<br /> |
| 126 | + |
| 127 | +## Manage App `Users` |
| 128 | + |
| 129 | +By default, the starter is not provided with users. To access the private pages and the admin section (reserved for `superusers`) follow up the next sections. |
| 130 | + |
| 131 | +### 👉 Create `Superusers` |
| 132 | + |
| 133 | +To access the `admin` section, Django requires `superuser` privilegies. Let's create a new `superuser` and access the `admin` section of the project: |
| 134 | + |
| 135 | +```bash |
| 136 | +$ python manage.py createsuperuser |
| 137 | +``` |
| 138 | + |
| 139 | +Once the `superuser` is successfully created, we can access the `admin` section: |
| 140 | + |
| 141 | +`http://localhost:8000/admin/` (make sure you have a `/` at the end). |
| 142 | + |
| 143 | + |
| 144 | +### 👉 Create (Ordinary) Users |
| 145 | + |
| 146 | +By default, the app redirects guest users to authenticate. In order to access the private pages, follow this set up: |
| 147 | + |
| 148 | +- Start the app via `python manage.py runserver` |
| 149 | +- Access the `registration` page and create a new user: |
| 150 | + - `http://127.0.0.1:8000/register/` |
| 151 | +- Access the `sign in` page and authenticate |
| 152 | + - `http://127.0.0.1:8000/login/` |
| 153 | + |
| 154 | +<br /> |
| 155 | + |
| 156 | +## Codebase Structure |
| 157 | + |
| 158 | +The project is coded using a simple and intuitive structure presented below: |
| 159 | + |
| 160 | +```bash |
| 161 | +< PROJECT ROOT > |
| 162 | + | |
| 163 | + |-- core/ # Implements app configuration |
| 164 | + | |-- settings.py # Defines Global Settings |
| 165 | + | |-- wsgi.py # Start the app in production |
| 166 | + | |-- urls.py # Define URLs served by all apps/nodes |
| 167 | + | |
| 168 | + |-- apps/ |
| 169 | + | | |
| 170 | + | |-- home/ # A simple app that serve HTML files |
| 171 | + | | |-- views.py # Serve HTML pages for authenticated users |
| 172 | + | | |-- urls.py # Define some super simple routes |
| 173 | + | | |
| 174 | + | |-- authentication/ # Handles auth routes (login and register) |
| 175 | + | | |-- urls.py # Define authentication routes |
| 176 | + | | |-- views.py # Handles login and registration |
| 177 | + | | |-- forms.py # Define auth forms (login and register) |
| 178 | + | | |
| 179 | + | |-- static/ |
| 180 | + | | |-- <css, JS, images> # CSS files, Javascripts files |
| 181 | + | | |
| 182 | + | |-- templates/ # Templates used to render pages |
| 183 | + | |-- includes/ # HTML chunks and components |
| 184 | + | | |-- navigation.html # Top menu component |
| 185 | + | | |-- footer.html # App Footer |
| 186 | + | | |-- scripts.html # Scripts common to all pages |
| 187 | + | | |
| 188 | + | |-- layouts/ # Master pages |
| 189 | + | | |-- base.html # Used by common pages |
| 190 | + | | |
| 191 | + | |-- accounts/ # Authentication pages |
| 192 | + | | |-- login.html # Login page |
| 193 | + | | |-- register.html # Register page |
| 194 | + | | |
| 195 | + | |-- home/ # UI Kit Pages |
| 196 | + | |-- index.html # Index page |
| 197 | + | |-- page-404.html # 404 page |
| 198 | + | |-- *.html # All other pages |
| 199 | + | |
| 200 | + |-- requirements.txt # Development modules - SQLite storage |
| 201 | + | |
| 202 | + |-- .env # Inject Configuration via Environment |
| 203 | + |-- manage.py # Start the app - Django default start script |
| 204 | + | |
| 205 | + |-- ************************************************************************ |
| 206 | +``` |
| 207 | + |
| 208 | +<br /> |
| 209 | + |
| 210 | +## Resources |
| 211 | + |
| 212 | +- 👉 Free [Support](https://appseed.us/support/) via Email & Discord |
| 213 | +- 👉 [Custom Development Services](https://appseed.us/custom-development/) provided by experts |
| 214 | +- 🚀 [Django Datta Able PRO](https://appseed.us/product/datta-able-pro/django/) - `Premium Version` |
| 215 | + - ✅ `Enhanced UI` - more pages and components |
| 216 | + - ✅ `Priority` on support |
| 217 | + |
| 218 | + |
0 commit comments