Skip to content

Commit 0f79bce

Browse files
committed
v1.0.0 - Initial Commit
1 parent 1c64505 commit 0f79bce

35 files changed

+619
-0
lines changed

.gitignore

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
*.pyc
2+
*.DS_Store
3+
*.egg*
4+
/dist/
5+
/.idea
6+
/docs/_build/
7+
/node_modules/
8+
build/
9+
env
10+
11+
#src
12+
*.sqlite*
13+
14+
static/dist/
15+
.env
16+
package-lock.json
17+
yarn.lock

.node-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
v22.0.0

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Change Log
2+
3+
## [1.0.0] 2025-02-19
4+
### Changes
5+
6+
- Integrate:
7+
- Vite
8+
- Tailwind `v3.4.1`
9+
- Flowbite `v2.2.1`

Dockerfile

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
FROM python:3.9
2+
3+
# set environment variables
4+
ENV PYTHONDONTWRITEBYTECODE 1
5+
ENV PYTHONUNBUFFERED 1
6+
7+
COPY requirements.txt .
8+
# install python dependencies
9+
RUN pip install --upgrade pip
10+
RUN pip install --no-cache-dir -r requirements.txt
11+
12+
COPY . .
13+
14+
# Static Files
15+
RUN python manage.py collectstatic --no-input
16+
17+
# running migrations
18+
RUN python manage.py makemigrations
19+
RUN python manage.py migrate
20+
21+
# Gunicorn
22+
EXPOSE 5005
23+
CMD ["gunicorn", "--config", "gunicorn-cfg.py", "core.wsgi"]

README.md

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# [Django & Flowbite/Tailwind](https://app-generator.dev/docs/technologies/django/integrate-flowbite.html) `Starter`
2+
3+
Minimal [Django starter that uses Flowbite/Tailwind](https://app-generator.dev/docs/technologies/django/integrate-flowbite.html) for styling and Vite as builder tool.
4+
5+
- Support: https://app-generator.dev/
6+
- [Django & Flowbite/Tailwind](https://app-generator.dev/docs/technologies/django/integrate-flowbite.html) - Integration Guide
7+
8+
<br />
9+
10+
## Deploy on `Render` (free plan)
11+
12+
[![Deploy to Render](https://render.com/images/deploy-to-render-button.svg)](https://render.com/deploy)
13+
14+
<br />
15+
16+
## Manual Build
17+
18+
> 👉 Download the code
19+
20+
```bash
21+
$ git clone https://github.com/app-generator/docs-django-daisy-ui.git
22+
$ cd docs-django-daisy-ui
23+
```
24+
25+
<br />
26+
27+
> 👉 Install modules via `VENV`
28+
29+
```bash
30+
$ virtualenv env
31+
$ source env/bin/activate
32+
$ pip install -r requirements.txt
33+
```
34+
35+
<br />
36+
37+
> 👉 Set Up Database
38+
39+
```bash
40+
$ python manage.py makemigrations
41+
$ python manage.py migrate
42+
```
43+
44+
<br />
45+
46+
> 👉 Compile Flowbite/Tailwind
47+
48+
```bash
49+
$ yarn
50+
$ yarn dev # development
51+
$ yarn build # production
52+
```
53+
54+
<br />
55+
56+
> 👉 Start the app
57+
58+
```bash
59+
$ python manage.py runserver
60+
```
61+
62+
At this point, the app runs at `http://127.0.0.1:8000/`.
63+
64+
<br />
65+
66+
---
67+
[Django & Flowbite/Tailwind](https://app-generator.dev/docs/technologies/django/integrate-flowbite.html)- Minimal **Django** core provided by **[App-Generaror](https://app-generator.dev/)**

build.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/usr/bin/env bash
2+
# exit on error
3+
set -o errexit
4+
5+
# UI Build
6+
yarn ; yarn build
7+
8+
# Install modules
9+
python -m pip install --upgrade pip
10+
pip install -r requirements.txt
11+
12+
# Collect Static
13+
python manage.py collectstatic --no-input
14+
15+
# Migrate DB
16+
python manage.py makemigrations
17+
python manage.py migrate
18+

core/__init__.py

Whitespace-only changes.

core/asgi.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
"""
2+
ASGI config for core project.
3+
4+
It exposes the ASGI callable as a module-level variable named ``application``.
5+
6+
For more information on this file, see
7+
https://docs.djangoproject.com/en/4.1/howto/deployment/asgi/
8+
"""
9+
10+
import os
11+
12+
from django.core.asgi import get_asgi_application
13+
14+
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "core.settings")
15+
16+
application = get_asgi_application()

core/settings.py

Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
"""
2+
Django settings for core project.
3+
4+
Generated by 'django-admin startproject' using Django 4.1.2.
5+
6+
For more information on this file, see
7+
https://docs.djangoproject.com/en/4.1/topics/settings/
8+
9+
For the full list of settings and their values, see
10+
https://docs.djangoproject.com/en/4.1/ref/settings/
11+
"""
12+
13+
import os, random, string
14+
from pathlib import Path
15+
16+
# Build paths inside the project like this: BASE_DIR / 'subdir'.
17+
BASE_DIR = Path(__file__).resolve().parent.parent
18+
19+
# Quick-start development settings - unsuitable for production
20+
# See https://docs.djangoproject.com/en/4.1/howto/deployment/checklist/
21+
22+
# SECURITY WARNING: keep the secret key used in production secret!
23+
SECRET_KEY = "django-insecure-b+$5wugqo%4&wt1+^jy+6x+#p3z*f__c__7(j9-4qp@24nl65n"
24+
25+
# SECURITY WARNING: don't run with debug turned on in production!
26+
DEBUG = True
27+
28+
# Hosts Settings
29+
ALLOWED_HOSTS = ['localhost', '127.0.0.1', '.onrender.com', '0.0.0.0']
30+
CSRF_TRUSTED_ORIGINS = ['http://localhost:8000', 'http://localhost:5085', 'http://127.0.0.1:8000', 'http://127.0.0.1:5085', 'https://core-django.onrender.com']
31+
32+
# Application definition
33+
34+
INSTALLED_APPS = [
35+
"django.contrib.admin",
36+
"django.contrib.auth",
37+
"django.contrib.contenttypes",
38+
"django.contrib.sessions",
39+
"django.contrib.messages",
40+
"django.contrib.staticfiles",
41+
42+
# APPS
43+
"home",
44+
45+
# Util
46+
"debug_toolbar",
47+
"django_browser_reload",
48+
]
49+
50+
MIDDLEWARE = [
51+
"django.middleware.security.SecurityMiddleware",
52+
"whitenoise.middleware.WhiteNoiseMiddleware",
53+
"django.contrib.sessions.middleware.SessionMiddleware",
54+
"django.middleware.common.CommonMiddleware",
55+
"django.middleware.csrf.CsrfViewMiddleware",
56+
"django.contrib.auth.middleware.AuthenticationMiddleware",
57+
"django.contrib.messages.middleware.MessageMiddleware",
58+
"django.middleware.clickjacking.XFrameOptionsMiddleware",
59+
60+
# Util
61+
"debug_toolbar.middleware.DebugToolbarMiddleware",
62+
"django_browser_reload.middleware.BrowserReloadMiddleware",
63+
]
64+
65+
ROOT_URLCONF = "core.urls"
66+
67+
UI_TEMPLATES = os.path.join(BASE_DIR, 'templates')
68+
69+
TEMPLATES = [
70+
{
71+
"BACKEND": "django.template.backends.django.DjangoTemplates",
72+
"DIRS": [UI_TEMPLATES],
73+
"APP_DIRS": True,
74+
"OPTIONS": {
75+
"context_processors": [
76+
"django.template.context_processors.debug",
77+
"django.template.context_processors.request",
78+
"django.contrib.auth.context_processors.auth",
79+
"django.contrib.messages.context_processors.messages",
80+
],
81+
},
82+
},
83+
]
84+
85+
WSGI_APPLICATION = "core.wsgi.application"
86+
87+
88+
# Database
89+
# https://docs.djangoproject.com/en/4.1/ref/settings/#databases
90+
91+
DATABASES = {
92+
"default": {
93+
"ENGINE": "django.db.backends.sqlite3",
94+
"NAME": BASE_DIR / "db.sqlite3",
95+
}
96+
}
97+
98+
99+
# Password validation
100+
# https://docs.djangoproject.com/en/4.1/ref/settings/#auth-password-validators
101+
102+
AUTH_PASSWORD_VALIDATORS = [
103+
{
104+
"NAME": "django.contrib.auth.password_validation.UserAttributeSimilarityValidator",
105+
},
106+
{
107+
"NAME": "django.contrib.auth.password_validation.MinimumLengthValidator",
108+
},
109+
{
110+
"NAME": "django.contrib.auth.password_validation.CommonPasswordValidator",
111+
},
112+
{
113+
"NAME": "django.contrib.auth.password_validation.NumericPasswordValidator",
114+
},
115+
]
116+
117+
118+
# Internationalization
119+
# https://docs.djangoproject.com/en/4.1/topics/i18n/
120+
121+
LANGUAGE_CODE = "en-us"
122+
123+
TIME_ZONE = "UTC"
124+
125+
USE_I18N = True
126+
127+
USE_TZ = True
128+
129+
130+
# Static files (CSS, JavaScript, Images)
131+
# https://docs.djangoproject.com/en/4.1/howto/static-files/
132+
133+
STATIC_URL = "static/"
134+
135+
STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')
136+
137+
STATICFILES_DIRS = (
138+
os.path.join(BASE_DIR, 'static'),
139+
)
140+
141+
# Default primary key field type
142+
# https://docs.djangoproject.com/en/4.1/ref/settings/#default-auto-field
143+
144+
DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField"

core/urls.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
"""core URL Configuration
2+
3+
The `urlpatterns` list routes URLs to views. For more information please see:
4+
https://docs.djangoproject.com/en/4.1/topics/http/urls/
5+
Examples:
6+
Function views
7+
1. Add an import: from my_app import views
8+
2. Add a URL to urlpatterns: path('', views.home, name='home')
9+
Class-based views
10+
1. Add an import: from other_app.views import Home
11+
2. Add a URL to urlpatterns: path('', Home.as_view(), name='home')
12+
Including another URLconf
13+
1. Import the include() function: from django.urls import include, path
14+
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
15+
"""
16+
from django.contrib import admin
17+
from django.urls import path, include
18+
19+
urlpatterns = [
20+
path("", include("home.urls")),
21+
path("admin/", admin.site.urls),
22+
path("__debug__/", include("debug_toolbar.urls")),
23+
]

0 commit comments

Comments
 (0)