mirror of
https://github.com/django-components/django-components.git
synced 2025-09-19 04:09:44 +00:00
![]()
Some checks are pending
Docs - build & deploy / docs (push) Waiting to run
Run tests / build (ubuntu-latest, 3.10) (push) Waiting to run
Run tests / build (ubuntu-latest, 3.11) (push) Waiting to run
Run tests / build (ubuntu-latest, 3.12) (push) Waiting to run
Run tests / build (ubuntu-latest, 3.13) (push) Waiting to run
Run tests / build (ubuntu-latest, 3.8) (push) Waiting to run
Run tests / test_sampleproject (3.13) (push) Waiting to run
Run tests / build (ubuntu-latest, 3.9) (push) Waiting to run
Run tests / build (windows-latest, 3.10) (push) Waiting to run
Run tests / build (windows-latest, 3.11) (push) Waiting to run
Run tests / build (windows-latest, 3.12) (push) Waiting to run
Run tests / build (windows-latest, 3.13) (push) Waiting to run
Run tests / build (windows-latest, 3.8) (push) Waiting to run
Run tests / build (windows-latest, 3.9) (push) Waiting to run
Run tests / test_docs (3.13) (push) Waiting to run
|
||
---|---|---|
.. | ||
calendarapp | ||
components | ||
sampleproject | ||
.gitignore | ||
manage.py | ||
README.md | ||
requirements.txt |
Sample Django project with django_components
Installation
-
Prepare virtual environment:
python -m venv .venv source .venv/bin/activate
-
Install dependencies:
pip install -r requirements.txt
Development server
python manage.py runserver
The app will be available at http://localhost:8000/.
Serving static files
Assuming that you're running the dev server with DEBUG=True
setting, ALL
static files (JS/CSS/HTML/PY) will be accessible under the /static/
URL path.
Production server
-
Prepare static files
python manage.py collectstatic
-
Set
DEBUG = False
in settings.py. -
Start server with gunicorn
gunicorn sampleproject.wsgi:application
The app will be available at http://localhost:8000/.
Serving static files
This project uses WhiteNoise to configure Django to serve static files even for production environment.
Assuming that you're running the prod server with:
DEBUG = False
setting"django.contrib.staticfiles"
in theINSTALLED_APPS
Then Django will server only JS and CSS files under the /static/
URL path.
You can verify that this is true by starting the prod server and then navigating to: