Minimal Django project setup template.
Create a .env
file by copying the .env.example
contents and add the
corresponding values.
APP_DEBUG=false
APP_ALLOWED_HOST=https://example.com
Create an app:
poetry shell
python manage.py startapp myapp
Add the app to the INSTALLED_APPS
in core/settings.py
:
INSTALLED_APPS = [
...,
myapp,
]
Create your templates in myapp/templates/
, then extend the provided layout:
{% extends 'layout.html' %}
{% block title %}My App Title{% endblock title %}
{% block content %}
<h1 class="text-2xl text-blue-600 font-semibold">Hello, world!</h1>
{% endblock content %}
For the Django server, open a terminal and run:
poetry shell
python manage.py runserver
To build the css assets, run:
yarn run dev
For production ready assets:
yarn run build