Skip to content

Commit 6497f81

Browse files
authored
Merge pull request #29 from fasouto/fix/deploy-button-url
Simpilfy home page checklist and update README
2 parents 5555959 + fabc9cb commit 6497f81

4 files changed

Lines changed: 35 additions & 18 deletions

File tree

apps/base/templates/base/home.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ <h1>Your Django app is running!</h1>
1414
</div>
1515

1616
<div class="checklist">
17-
<h2>Next steps</h2>
17+
<h2>Status</h2>
1818
<ul>
1919
{% for label, hint, done in checklist %}
2020
<li class="{% if done %}done{% endif %}">
@@ -26,6 +26,7 @@ <h2>Next steps</h2>
2626
</li>
2727
{% endfor %}
2828
</ul>
29+
<p class="hint">To get started, edit <code>apps/base/templates/base/home.html</code></p>
2930
</div>
3031

3132
<div class="quick-links">

apps/base/views.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,10 @@ def home(request):
2121
secret_changed = secret_key not in ("django-insecure-dev-key-change-me", "build-time-placeholder", "change-me-to-a-random-string")
2222
rv = '<a href="https://docs.railway.com/variables" target="_blank">Railway variables</a>'
2323
checklist = [
24-
("Database connected", "Set DATABASE_URL in .env or {}".format(rv), db_ok),
25-
("PostgreSQL configured", "Use postgres:// instead of sqlite:///", db_is_postgres),
24+
("Database", "Set DATABASE_URL in .env or {}".format(rv), db_ok and (db_is_postgres or settings.DEBUG)),
2625
("SECRET_KEY changed", "Set a unique key in .env or {}".format(rv), secret_changed),
2726
("DEBUG is off", "Set DEBUG=False in production", not settings.DEBUG),
28-
("Set ALLOWED_HOSTS", "Add your domain to ALLOWED_HOSTS in {}".format(rv), not settings.DEBUG and len(settings.ALLOWED_HOSTS) > 0),
29-
("Configure CSRF_TRUSTED_ORIGINS", "Add https://yourdomain to CSRF_TRUSTED_ORIGINS in {}".format(rv), len(settings.CSRF_TRUSTED_ORIGINS) > 0 if hasattr(settings, "CSRF_TRUSTED_ORIGINS") else False),
30-
("Edit this page", "apps/base/templates/base/home.html", False),
27+
("ALLOWED_HOSTS set", "Add your domain to ALLOWED_HOSTS in {}".format(rv), not settings.DEBUG and len(settings.ALLOWED_HOSTS) > 0),
3128
]
3229

3330
return render(

config/static/css/base.css

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,21 @@ main { padding: 3rem 0 4rem; }
122122
color: #fff;
123123
}
124124

125+
/* Hint */
126+
.hint {
127+
font-size: 0.72rem;
128+
color: var(--color-muted);
129+
font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
130+
margin-top: 0.75rem;
131+
padding-top: 0.75rem;
132+
border-top: 1px solid var(--color-border);
133+
}
134+
.hint code {
135+
background: var(--color-green-light);
136+
padding: 0.1em 0.35em;
137+
border-radius: 3px;
138+
}
139+
125140
/* Links */
126141
.quick-links {
127142
display: flex;

readme.md

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
# django-starter-template
1+
<p align="center">
2+
<img src="config/static/img/django-pony.png" alt="Django Pony" width="80">
3+
</p>
4+
5+
<h1 align="center">Django Starter Template</h1>
26

37
A production-ready Django 5.2 LTS starter template for [Railway](https://railway.com).
48

@@ -116,16 +120,16 @@ Open [http://localhost:8000](http://localhost:8000). Code changes reload automat
116120

117121
## What's Included
118122

119-
- **[Django 5.2 LTS](https://docs.djangoproject.com/en/5.2/)** supported until April 2028
120-
- **[PostgreSQL](https://www.postgresql.org/)** via psycopg3 modern async-capable adapter
121-
- **[WhiteNoise](https://whitenoise.readthedocs.io/)** serve static files without nginx, with brotli compression
122-
- **[django-environ](https://django-environ.readthedocs.io/)** configure via environment variables and `.env` files
123-
- **[Argon2](https://docs.djangoproject.com/en/5.2/topics/auth/passwords/#using-argon2-with-django)** password hashing (winner of the Password Hashing Competition)
124-
- **Split settings** separate development and production configurations
125-
- **Health check** `/health/` endpoint returns JSON for Railway monitoring
126-
- **[django-debug-toolbar](https://django-debug-toolbar.readthedocs.io/)** SQL queries, templates, cache inspection (dev only)
127-
- **[ruff](https://docs.astral.sh/ruff/)** linting and formatting
128-
- **[pytest](https://docs.pytest.org/) + [pytest-django](https://pytest-django.readthedocs.io/)** testing
123+
- **[Django 5.2 LTS](https://docs.djangoproject.com/en/5.2/)**: supported until April 2028
124+
- **[PostgreSQL](https://www.postgresql.org/)** via psycopg3, modern async-capable adapter
125+
- **[WhiteNoise](https://whitenoise.readthedocs.io/)**: serve static files without nginx, with brotli compression
126+
- **[django-environ](https://django-environ.readthedocs.io/)**: configure via environment variables and `.env` files
127+
- **[Argon2](https://docs.djangoproject.com/en/5.2/topics/auth/passwords/#using-argon2-with-django)** password hashing (winner of the Password Hashing Competition)
128+
- **Split settings** for separate development and production configurations
129+
- **Health check** at `/health/`, returns JSON for Railway monitoring
130+
- **[django-debug-toolbar](https://django-debug-toolbar.readthedocs.io/)**: SQL queries, templates, cache inspection (dev only)
131+
- **[ruff](https://docs.astral.sh/ruff/)** for linting and formatting
132+
- **[pytest](https://docs.pytest.org/) + [pytest-django](https://pytest-django.readthedocs.io/)** for testing
129133

130134
## Customization
131135

@@ -148,4 +152,4 @@ Add `celery[redis]` to your dependencies, create `config/celery.py`, and add a R
148152

149153
## License
150154

151-
MIT — see [LICENSE](LICENSE).
155+
MIT. See [LICENSE](LICENSE).

0 commit comments

Comments
 (0)