Skip to content

Commit 32308b5

Browse files
committed
Rocket Django - Update Docs
1 parent 94d6153 commit 32308b5

File tree

1 file changed

+176
-4
lines changed

1 file changed

+176
-4
lines changed

docs/products/rocket/django.mdx

+176-4
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,182 @@ sidebar_label: Rocket Django
77

88
<SubHeading>Open-source Django Starter styled with Tailwind and Flowbite.</SubHeading>
99

10-
@Todo
10+
This open-source starter incorporates a few modern technologies provided out-of-the-box, at a production-ready level.
11+
[Rocket Django](https://github.com/app-generator/rocket-django) is actively versioned by AppSeed.
1112

12-
<br />
13+
- 👉 [Rocket Django](https://rocket-django.onrender.com/) - `LIVE Demo`
14+
- 👉 [Rocket Django](https://github.com/app-generator/rocket-django) - `Source Code`
1315

14-
## Resources
16+
![Rocket Django - Open-source Django Starter styled with Tailwind and Flowbite](https://github-production-user-asset-6210df.s3.amazonaws.com/51070104/276511947-84207026-b13d-4eff-bdf6-04a7b1a10c6c.jpg)
1517

16-
@Todo
18+
## ✅ Product Features
19+
20+
The codebase is shipped with basic features that are usually implemented in most of the projects:
21+
22+
- Up-to-date Dependencies
23+
- Tailwind/Flowbite Integration via WebPack
24+
- `Extended User Model`
25+
- [API](https://rocket-django.onrender.com/api/product/) via `DRF`
26+
- [Charts](https://rocket-django.onrender.com/charts/)
27+
- [DataTables](https://rocket-django.onrender.com/tables/) (native Django)
28+
- `Celery Beat`
29+
- Docker
30+
31+
## ✅ Manual Build
32+
33+
> Download code
34+
35+
```bash
36+
$ git clone https://github.com/app-generator/rocket-django.git
37+
$ cd rocket-django
38+
```
39+
40+
> Install Node Modules
41+
42+
```
43+
$ npm i
44+
$ npm run build
45+
```
46+
47+
> Install **Django** modules via `VENV`
48+
49+
```bash
50+
$ virtualenv env
51+
$ source env/bin/activate
52+
$ pip install -r requirements.txt
53+
```
54+
55+
> Install **Tailwind/Flowbite** (separate terminal)
56+
57+
```bash
58+
$ npm install
59+
$ npm run dev
60+
```
61+
62+
> Migrate DB
63+
64+
```
65+
$ python manage.py makemigrations
66+
$ python manage.py migrate
67+
```
68+
69+
> Create Superuser & Start the APP
70+
71+
```
72+
$ python manage.py createsuperuser # create the admin
73+
$ python manage.py runserver # start the project
74+
```
75+
76+
At this point, we should be able to access **Rocket Django** in the browser.
77+
78+
79+
## ✅ Codebase
80+
81+
```bash
82+
< PROJECT ROOT >
83+
|
84+
|-- core/ # Project Settings
85+
| |-- settings.py
86+
| |-- wsgi.py
87+
| |-- urls.py
88+
|
89+
|-- home/ # Presentation app
90+
| |-- views.py # serve the HOMEpage
91+
| |-- urls.py
92+
| |-- models.py
93+
|
94+
|-- apps/ # Utility Apps
95+
| |-- common/ # defines models & helpers
96+
| | |-- models.py
97+
| | |-- util.py
98+
| |-- users # Handles Authentication
99+
| |-- api # DRF managed API
100+
| |-- charts # Showcase Different Charts
101+
| |-- tables # Implements DataTables
102+
| |-- tasks # Celery, async processing
103+
|
104+
|-- templates/ # UI templates
105+
|-- static/ # Tailwind/Flowbite
106+
| |-- src/ #
107+
| |-- input.css # CSS Styling
108+
|
109+
|-- Dockerfile # Docker
110+
|-- docker-compose.yml # Docker
111+
|
112+
|-- render.yml # CI/CD for Render
113+
|-- build.sh # CI/CD for Render
114+
|
115+
|-- manage.py # Django Entry-Point
116+
|-- requirements.txt # dependencies
117+
|-- .env # ENV File
118+
|
119+
|-- *************************************************
120+
```
121+
122+
123+
## ✅ Extended User Profile
124+
125+
Authenticated user are able to save their information and an IMAGE avatar.
126+
The fields that manage the user information can be found in [apps/users/models.py](https://github.com/app-generator/rocket-django/blob/main/apps/users/models.py)
127+
128+
```python
129+
ROLE_CHOICES = (
130+
('admin' , 'Admin'),
131+
('user' , 'User'),
132+
)
133+
class Profile(models.Model):
134+
user = models.OneToOneField(User, on_delete=models.CASCADE)
135+
role = models.CharField(max_length=20, choices=ROLE_CHOICES, default='user')
136+
full_name = models.CharField(max_length=255, null=True, blank=True)
137+
country = models.CharField(max_length=255, null=True, blank=True)
138+
city = models.CharField(max_length=255, null=True, blank=True)
139+
zip_code = models.CharField(max_length=255, null=True, blank=True)
140+
address = models.CharField(max_length=255, null=True, blank=True)
141+
phone = models.CharField(max_length=255, null=True, blank=True)
142+
avatar = models.ImageField(upload_to='avatar', null=True, blank=True)
143+
144+
def __str__(self):
145+
return self.user.username
146+
```
147+
148+
Here is the correspondent UI (requires authentication)
149+
150+
![Rocket Django - Extended User Profile.](https://github-production-user-asset-6210df.s3.amazonaws.com/51070104/276511951-8eaf56b6-a77a-44a1-afba-1db4e6d584bb.jpg)
151+
152+
153+
## ✅ API Via DRF
154+
155+
The [Products](https://github.com/app-generator/rocket-django/blob/main/apps/common/models.py) model is managed in two different ways: via API (powered by DRF) and a simple, intuitive DataTable view.
156+
157+
```python
158+
class Product(models.Model):
159+
id = models.AutoField(primary_key=True)
160+
name = models.CharField(max_length = 100)
161+
info = models.CharField(max_length = 100, default = '')
162+
price = models.IntegerField(blank=True, null=True)
163+
164+
def __str__(self):
165+
return self.name
166+
```
167+
168+
The authenticated users are able to submit products using the DRF UI:
169+
170+
![Rocket Django - API via DRF.](https://github-production-user-asset-6210df.s3.amazonaws.com/51070104/276511957-e3eb8f75-316a-4c01-a3fe-0cbe6287c0da.jpg)
171+
172+
173+
## ✅ DataTables
174+
175+
`Products` information can be easily managed using the DataTable layout styled with Tailwind & Flowbite. Supported features:
176+
177+
- Create/Update/Delete
178+
- Pagination
179+
- Search
180+
181+
![Rocket Django - DataTables over the Product Table.](https://github-production-user-asset-6210df.s3.amazonaws.com/51070104/276511955-5e279cab-6ee4-49a2-b584-b93b6c2a0f18.jpg)
182+
183+
## ✅ Resources
184+
185+
- 👉 Access [AppSeed](https://appseed.us/) for more starters and support
186+
- 👉 [Deploy Projects on Aws, Azure and DO](https://www.docs.deploypro.dev/) via **DeployPRO**
187+
- 👉 Create landing pages with [Simpllo, an open-source site builder](https://www.simpllo.com/)
188+
- 👉 Build apps with [Django App Generator](https://app-generator.dev/django/) (free service)

0 commit comments

Comments
 (0)