Skip to content
This repository has been archived by the owner on Feb 28, 2023. It is now read-only.

Latest commit

 

History

History
52 lines (31 loc) · 1.66 KB

views.rst

File metadata and controls

52 lines (31 loc) · 1.66 KB

Asset views

Serving assets in development

django_gears.views

Django Gears provides the :pyserve view for use in development. This view will process and serve any matching assets on the fly. This means you can simply reload your pages to see the latest changes.

Further, if no matching asset is found, serve falls back to Django's staticfiles.views.serve view. This means your application can happily serve static files alongside Gear's assets.

The easiest way to make use of the serve view in your application is to use the included ~django_gears.urls.gears_urlpatterns function.

from django_gears.urls import gears_urlpatterns

# url definitions here

urlpatterns += gears_urlpatterns()

Sites using these urlpatterns will not need to use Django's staticfiles urlpatterns.

Warning

Like staticfiles_urlpatterns, gears_urlpatterns only registers patterns when settings.Debug is True. This isn't for production use. See the Deployment docs <deploying> for more information.

Gears urlpatterns

django_gears.urls