|
| 1 | +--- |
| 2 | +title: Django Admin Datta PRO - Premium UI LIbrary |
| 3 | +sidebar_label: Django Admin Datta PRO |
| 4 | +--- |
| 5 | + |
| 6 | +# [Django Admin Datta PRO](https://appseed.us/product/datta-able-pro/django/) |
| 7 | + |
| 8 | +<SubHeading>Premium Library for Django admin section styled with Datta Able Dashboard (premium version)</SubHeading> |
| 9 | + |
| 10 | +Modern template for **Django** that covers `Admin Section`, all authentication pages (registration included) crafted on top of [Datta Able](https://appseed.us/product/datta-able-pro/django/), |
| 11 | +a premium `Bootstrap` design from [CodedThemes](https://codedthemes.com/?ref=appseed). |
| 12 | + |
| 13 | +:::info Library ` requires a license delivered with ` [Django Datta Able PRO](https://appseed.us/product/datta-able-pro/django/) |
| 14 | +::: |
| 15 | + |
| 16 | + |
| 17 | +**Links & Resources** |
| 18 | + |
| 19 | +- [Django Datta PRO](/products/django-dashboards/datta-able-pro/) - `Product` that uses the library |
| 20 | + - `Features`: Fully-configured, `CI/CD` via Render |
| 21 | +- UI Kit: Datta Able PRO `v1.0.2` |
| 22 | +- **Sections Covered**: |
| 23 | + - `Admin Section`, reserved for `superusers` |
| 24 | + - `All pages` managed by `Django.contrib.AUTH` |
| 25 | + - `Registration` page |
| 26 | + - `Misc pages`: colors, icons, typography, blank-page |
| 27 | + |
| 28 | + |
| 29 | + |
| 30 | + |
| 31 | +## How to use it |
| 32 | + |
| 33 | +<br /> |
| 34 | + |
| 35 | +> **Install the package** via `PIP` (private repository, `requires a license`) |
| 36 | +
|
| 37 | +```bash |
| 38 | +$ pip install git+https://github.com/app-generator/priv-django-admin-datta-pro.git |
| 39 | +``` |
| 40 | + |
| 41 | +<br /> |
| 42 | + |
| 43 | +> Add `admin_datta_pro` application to the `INSTALLED_APPS` setting of your Django project `settings.py` file (note it should be before `django.contrib.admin`): |
| 44 | +
|
| 45 | +```python |
| 46 | + INSTALLED_APPS = ( |
| 47 | + ... |
| 48 | + 'admin_datta_pro.apps.AdminDattaProConfig', |
| 49 | + 'django.contrib.admin', |
| 50 | + ) |
| 51 | +``` |
| 52 | + |
| 53 | +<br /> |
| 54 | + |
| 55 | +> Add `LOGIN_REDIRECT_URL` and `EMAIL_BACKEND` of your Django project `settings.py` file: |
| 56 | +
|
| 57 | +```python |
| 58 | + LOGIN_REDIRECT_URL = '/' |
| 59 | + # EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend' |
| 60 | + EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend' |
| 61 | +``` |
| 62 | + |
| 63 | +<br /> |
| 64 | + |
| 65 | +> Add `admin_datta_pro` urls in your Django Project `urls.py` file |
| 66 | +
|
| 67 | +```python |
| 68 | + from django.urls import path, include |
| 69 | + |
| 70 | + urlpatterns = [ |
| 71 | + ... |
| 72 | + path('', include('admin_datta_pro.urls')), |
| 73 | + ] |
| 74 | +``` |
| 75 | + |
| 76 | +<br /> |
| 77 | + |
| 78 | +> **Collect static** if you are in `production environment`: |
| 79 | +
|
| 80 | +```bash |
| 81 | +$ python manage.py collectstatic |
| 82 | +``` |
| 83 | + |
| 84 | +<br /> |
| 85 | + |
| 86 | +> **Start the app** |
| 87 | +
|
| 88 | +```bash |
| 89 | +$ # Set up the database |
| 90 | +$ python manage.py makemigrations |
| 91 | +$ python manage.py migrate |
| 92 | +$ |
| 93 | +$ # Create the superuser |
| 94 | +$ python manage.py createsuperuser |
| 95 | +$ |
| 96 | +$ # Start the application (development mode) |
| 97 | +$ python manage.py runserver # default port 8000 |
| 98 | +``` |
| 99 | + |
| 100 | +Access the `admin` section in the browser: `http://127.0.0.1:8000/` |
| 101 | + |
| 102 | + |
| 103 | +## How to Customize |
| 104 | + |
| 105 | +When a template file is loaded in the controller, `Django` scans all template directories starting from the ones defined by the user, and returns the first match or an error in case the template is not found. |
| 106 | +The theme used to style this starter provides the following files: |
| 107 | + |
| 108 | +```bash |
| 109 | +# This exists in ENV: LIB/admin_datta_pro |
| 110 | +< UI_LIBRARY_ROOT > |
| 111 | + | |
| 112 | + |-- templates/ # Root Templates Folder |
| 113 | + | | |
| 114 | + | |-- accounts/ |
| 115 | + | | |-- auth-signin.html # Sign IN Page |
| 116 | + | | |-- auth-signup.html # Sign UP Page |
| 117 | + | | |
| 118 | + | |-- includes/ |
| 119 | + | | |-- footer.html # Footer component |
| 120 | + | | |-- sidebar.html # Sidebar component |
| 121 | + | | |-- navigation.html # Navigation Bar |
| 122 | + | | |-- scripts.html # Scripts Component |
| 123 | + | | |
| 124 | + | |-- layouts/ |
| 125 | + | | |-- base.html # Masterpage |
| 126 | + | | |-- base-auth.html # Masterpage for Auth Pages |
| 127 | + | | |
| 128 | + | |-- pages/ |
| 129 | + | |-- index.html # INDEX page |
| 130 | + | |-- landingpage.html # Sample LP |
| 131 | + | |-- *.html # All other pages |
| 132 | + | |
| 133 | + |-- ************************************************************************ |
| 134 | +``` |
| 135 | + |
| 136 | +When the project requires customization, we need to copy the original file that needs an update (from the virtual environment) and place it in the template folder using the same path. |
| 137 | + |
| 138 | +For instance, if we want to customize the `index.html` these are the steps: |
| 139 | + |
| 140 | +- `Step 1`: create the `templates` DIRECTORY inside your app |
| 141 | +- `Step 2`: configure the project to use this new template directory |
| 142 | + - Edit `settings.py` TEMPLATES section |
| 143 | +- `Step 3`: copy the `index.html` from the original location (inside your ENV) and save it to the `YOUR_APP/templates` DIR |
| 144 | + - Source PATH: `<YOUR_ENV>/LIB/admin_datta_pro/templates/pages/index.html` |
| 145 | + - Destination PATH: `YOUR_APP/templates/pages/index.html` |
| 146 | +- Edit the `index` page (Destination PATH) |
| 147 | + |
| 148 | +At this point, the default version of the `index.html` shipped in the library is ignored by Django. |
| 149 | + |
| 150 | +In a similar way, all other files and components can be customized easily. |
| 151 | + |
| 152 | +## Resources |
| 153 | + |
| 154 | +- 👉 [Django Admin Datta PRO](https://appseed.us/product/datta-able-pro/django/) - `Product` that uses the library (fully configured) |
| 155 | +- 👉 Free [Support](https://appseed.us/support/) via Email & Discord |
0 commit comments