Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3.0.0 #72

Merged
merged 1 commit into from
Jan 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down
9 changes: 6 additions & 3 deletions docs/src/django.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand All @@ -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?"

Expand Down Expand Up @@ -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",
# ...
Expand Down
3 changes: 1 addition & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "[email protected]" }]
requires-python = ">=3.9"
classifiers = [
"Development Status :: 5 - Production/Stable",
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/servestatic/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Loading