django-uploadstatic er en Django app som gir hjelpere for opplasting av statiske filer.
Den er basert off av github.com/jezdez/django-staticfiles men bare laster opp alle filene i de innsamlede STATIC_ROOT til S3 med storages.backends.s3boto.S3BotoStorage lagring backend i Django-lagringen app.
Installasjon
- Bruk din favoritt Python emballasje verktøy for å installere uploadstatic fra PyPI, f.eks:
& Nbsp; pip installere django-uploadstatic
- Lagt til "uploadstatic" til din INSTALLED_APPS innstilling:
& Nbsp; INSTALLED_APPS = [
& Nbsp; # ...
& Nbsp; "uploadstatic",
& Nbsp;]
- Still ditt STATIC_URL innstilling til nettadressen som håndterer serverer statiske filer fra S3:
& Nbsp; STATIC_URL = "https://s3.amazonaws.com/some-domain/"
- Når du er klar til å laste opp alle statiske filer som har blitt COLLECTE i stedets STATIC_ROOT, bruker uploadstatic forvaltning kommandoen:
& Nbsp; python manage.py uploadstatic
. - Da filene dine vil være tilgjengelig fra STATIC_URL innstilling
Krav :
- Python
- Django
Kommentarer ikke funnet