@@ -30,17 +30,57 @@ $ pip install git+https://github.com/app-generator/django-dynamic-datatb.git
3030
3131<br />
3232
33- > ** Step #2 ** - ` Update Configuration ` , include the new APPs
33+ > ** Step #2 ** - Update Configuration, ` add new imports `
34+
35+ ``` python
36+ import os, inspect
37+ import django_dyn_dt
38+ ```
39+
40+ <br />
41+
42+ > ** Step #3 ** - Update Configuration, ` include the new APPs `
3443
3544``` python
3645INSTALLED_APPS = [
37- ' django_dyn_dt' , # Django Dynamic Data tables # <-- NEW
46+ ' django_dyn_dt' , # <-- NEW App
47+ ]
48+ ```
49+
50+ <br />
51+
52+ > ** Step #4 ** - Update Configuration, include the new ` TEMPLATES ` DIR
53+
54+ ``` python
55+
56+ TEMPLATE_DIR_DATATB = os.path.join(BASE_DIR , " django_dyn_dt/templates" ) # <-- NEW App
57+
58+ TEMPLATES = [
59+ {
60+ " BACKEND" : " django.template.backends.django.DjangoTemplates" ,
61+ " DIRS" : [TEMPLATE_DIR_DATATB ], # <-- NEW Include
62+ " APP_DIRS" : True ,
63+ " OPTIONS" : {
64+ },
65+ },
3866]
3967```
4068
4169<br />
4270
43- > ** Step #3 ** - ` Register the model ` in ` core/settings.py ` (DYNAMIC_API section)
71+ > ** Step #5 ** - Update Configuration, update ` STATICFILES_DIRS ` DIR
72+
73+ ``` python
74+ DYN_DB_PKG_ROOT = os.path.dirname( inspect.getfile( django_dyn_dt ) ) # <-- NEW App
75+
76+ STATICFILES_DIRS = (
77+ os.path.join(DYN_DB_PKG_ROOT , " templates/static" ),
78+ )
79+ ```
80+
81+ <br />
82+
83+ > ** Step #6 ** - ` Register the model ` in ` core/settings.py ` (DYNAMIC_DATATB section)
4484
4585This sample code assumes that ` app1 ` exists and model ` Book ` is defined and migrated.
4686
@@ -55,16 +95,8 @@ DYNAMIC_DATATB = {
5595
5696<br />
5797
58- > ** Step #4 ** - ` Migrate DB `
59-
60- ``` bash
61- $ python manage.py makemigrations
62- $ python manage.py migrate
63- ```
64-
65- <br />
6698
67- > ** Step #5 ** - ` Update routing ` , include APIs
99+ > ** Step #7 ** - ` Update routing ` , include APIs
68100
69101``` python
70102from django.contrib import admin
@@ -78,7 +110,7 @@ urlpatterns = [
78110
79111<br />
80112
81- > ** Step #7 ** - Use the Dynamic Datatable module
113+ > ** Step #8 ** - Use the Dynamic Datatable module
82114
83115If the managed model is ` Books ` , the dynamic interface is ` /datatb/books/ ` and all features available.
84116
0 commit comments