Skip to content

Commit

Permalink
3.0.0 (#72)
Browse files Browse the repository at this point in the history
Archmonger authored Jan 10, 2025
1 parent 180a448 commit 834a645
Showing 4 changed files with 16 additions and 7 deletions.
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -7,10 +7,16 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
<!--
Using the following categories, list your changes in this order:
[Added, Changed, Deprecated, Removed, Fixed, Security]
Don't forget to remove deprecated code on each major release!
-->

## [Unreleased]

- Nothing (yet)!

## [3.0.0] - 2025-01-10

### Changed

- Drop Django 3.2 and 4.1 support.
@@ -88,7 +94,8 @@ Using the following categories, list your changes in this order:

- Forked from [`whitenoise`](https://github.com/evansd/whitenoise) to add ASGI support.

[Unreleased]: https://github.com/Archmonger/ServeStatic/compare/2.1.1...HEAD
[Unreleased]: https://github.com/Archmonger/ServeStatic/compare/3.0.0...HEAD
[3.0.0]: https://github.com/Archmonger/ServeStatic/compare/2.1.1...3.0.0
[2.1.1]: https://github.com/Archmonger/ServeStatic/compare/2.1.0...2.1.1
[2.1.0]: https://github.com/Archmonger/ServeStatic/compare/2.0.1...2.1.0
[2.0.1]: https://github.com/Archmonger/ServeStatic/compare/2.0.0...2.0.1
9 changes: 6 additions & 3 deletions docs/src/django.md
Original file line number Diff line number Diff line change
@@ -6,7 +6,11 @@ We mention Heroku in a few places, but there's nothing Heroku-specific about Ser

## Step 1: Enable ServeStatic

Edit your `settings.py` file and add ServeStatic to the `MIDDLEWARE` list. The ServeStatic middleware should be placed directly after the Django [SecurityMiddleware](https://docs.djangoproject.com/en/stable/ref/middleware/#module-django.middleware.security) (if you are using it) and before all other middleware:
Edit your `settings.py` file and add ServeStatic to the `MIDDLEWARE` list.

!!! warning "Middleware order is important!"

The ServeStatic middleware should be placed directly after the Django [SecurityMiddleware](https://docs.djangoproject.com/en/stable/ref/middleware/#module-django.middleware.security) (if you are using it) and before all other middleware.

```python linenums="0"
MIDDLEWARE = [
@@ -16,7 +20,7 @@ MIDDLEWARE = [
]
```

That's it -- ServeStatic will now serve your static files. However, to get the best performance you should proceed to step 3 below and enable compression and caching.
That's it! ServeStatic is now configured to serve your static files. For optimal performance, proceed to the next step to enable compression and caching.

??? question "How should I order my middleware?"

@@ -145,7 +149,6 @@ You can disable Django's static file handling and allow ServeStatic to take over

```python linenums="0"
INSTALLED_APPS = [
# ...
"servestatic.runserver_nostatic",
"django.contrib.staticfiles",
# ...
3 changes: 1 addition & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@ description = "Production-grade static file server for Python web apps."
readme = "README.md"
keywords = ["asgi", "django", "http", "server", "static", "staticfiles", "wsgi"]
license = "MIT"
authors = [{ name = "Mark Bakhit" }]
authors = [{ name = "Mark Bakhit", email = "archiethemonger@gmail.com" }]
requires-python = ">=3.9"
classifiers = [
"Development Status :: 5 - Production/Stable",
@@ -124,7 +124,6 @@ update = ["pre-commit autoupdate"]
[tool.ruff]
line-length = 120
extend-exclude = [".eggs/*", ".nox/*", ".venv/*", "build/*"]

format.preview = true
lint.extend-ignore = [
"ARG001", # Unused function argument
2 changes: 1 addition & 1 deletion src/servestatic/__init__.py
Original file line number Diff line number Diff line change
@@ -3,6 +3,6 @@
from servestatic.asgi import ServeStaticASGI
from servestatic.wsgi import ServeStatic

__version__ = "2.1.1"
__version__ = "3.0.0"

__all__ = ["ServeStatic", "ServeStaticASGI"]

0 comments on commit 834a645

Please sign in to comment.