• This repository has been archived on 09/Jan/2018
  • Stars
    star
    127
  • Rank 282,790 (Top 6 %)
  • Language
    Python
  • License
    BSD 3-Clause "New...
  • Created about 15 years ago
  • Updated over 12 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

[Unmaintained] A Django app that provides helpers for serving static files, used in Django and Pinax.

django-staticfiles

This is a Django app that provides helpers for serving static files.

Django developers mostly concern themselves with the dynamic parts of web applications -- the views and templates that render new for each request. But web applications have other parts: the static media files (images, CSS, Javascript, etc.) that are needed to render a complete web page.

For small projects, this isn't a big deal, because you can just keep the media somewhere your web server can find it. However, in bigger projects -- especially those comprised of multiple apps -- dealing with the multiple sets of static files provided by each application starts to get tricky.

That's what staticfiles is for:

Collecting static files from each of your Django apps (and any other place you specify) into a single location that can easily be served in production.

The main website for django-staticfiles is github.com/jezdez/django-staticfiles where you can also file tickets.

Note

django-staticfiles is now part of Django (since 1.3) as django.contrib.staticfiles.

The django-staticfiles 0.3.X series will only receive security and data loss bug fixes after the release of django-staticfiles 1.0. Any Django 1.2.X project using django-staticfiles 0.3.X and lower should be upgraded to use either Django >= 1.3's staticfiles app or django-staticfiles >= 1.0 to profit from the new features and stability.

You may want to chose to use django-staticfiles instead of Django's own staticfiles app since any new feature (additionally to those backported from Django) will be released first in django-staticfiles.

Installation

  • Use your favorite Python packaging tool to install staticfiles from PyPI, e.g.:

    pip install django-staticfiles
    

    You can also install the in-development version of django-staticfiles with pip install django-staticfiles==dev.

  • Added "staticfiles" to your INSTALLED_APPS setting:

    INSTALLED_APPS = [
        # ...
        "staticfiles",
    ]
    
  • Set your STATIC_URL setting to the URL that handles serving static files:

    STATIC_URL = "/static/"
    
  • In development mode (when DEBUG = True) the runserver command will automatically serve static files:

    python manage.py runserver
    
  • Once you are ready to deploy all static files of your site in a central directory (STATIC_ROOT) to be served by a real webserver (e.g. Apache, Cherokee, Lighttpd, Nginx etc.), use the collectstatic management command:

    python manage.py collectstatic
    

    See the webserver's documentation for descriptions how to setup serving the deployment directory (STATIC_ROOT).

  • (optional) In case you use Django's admin app, make sure the ADMIN_MEDIA_PREFIX setting is set correctly to a subpath of STATIC_URL:

    ADMIN_MEDIA_PREFIX = STATIC_URL + "admin/"
    

More Repositories

1

textmate-missingdrawer

[UNMAINTAINED] A better sidebar for Textmate.
Objective-C
728
star
2

envdir

A Python port of daemontools' envdir.
Python
229
star
3

caniusepython3.com

A site to check if your Python project is compatible with Python 3
JavaScript
136
star
4

django-discover-runner

A Django test runner based on unittest2's test discovery.
Python
134
star
5

django-mobileadmin

[UNMAINTAINED] The Django admin interface optimized for iPhone/iPod touch. Pretty out of date, so be careful.
Python
117
star
6

python-startup

Python
35
star
7

pycompletion

[UNMAINTAINED] A lib to collect command line completion scripts of Python packages
Python
33
star
8

dokku-elasticsearch-plugin

[unmaintained] A working Elasticsearch plugin for Dokku (run Docker with -icc=true)
Shell
32
star
9

django-comment-utils

A fork of James Bennett's django-comment-utils that should work with Django 1.0
Python
31
star
10

django-memcached-hashring

A Django cache backend for Memcached with consistent hashing.
Python
20
star
11

gitserve

[OUTDATED, Use git instaweb instead] A helper tool for git that mimics mercurial's serve command.
Python
20
star
12

dokku-memcached-plugin

A working Memcached plugin for Dokku (run Docker with -icc=true)
Shell
19
star
13

dokku-redis-plugin

A working Redis plugin for Dokku (run Docker with -icc=true)
Shell
19
star
14

dokku-postgres-plugin

A working Postgres plugin for Dokku (run Docker with -icc=true)
Shell
17
star
15

django-rcsfield

UNSUPPORTED Mirror of django-rcsfield svn repository
Python
15
star
16

django-reusableapps

ZOMG, eggs are bad, don't use this.
Python
14
star
17

django-unchained

Python
13
star
18

django-sites-tools

DEPRECATED Use django-hosts instead!
Python
12
star
19

django-feedutil

Python
11
star
20

limechat-whisper

[UNMAINTAINED] Subtle theme for the IRC client LimeChat
11
star
21

django-vcstorage

A Django app that provides file storage backends and file fields for Mercurial, Git and Bazaar by using anyvc.
Python
10
star
22

django-ticker

A simple Django app that provides a ticker like news section including row level permission based workflow
Python
9
star
23

dokku-sentry-webhook

A plugin for Dokku that notifies Sentry of deployments for release tracking.
Shell
7
star
24

pownce-jabber-bot

A mirror of the old Subversion repository of the now defunkt Pownce jabber bot. Only for educational purposes..
Python
6
star
25

ressl

A SSL redirector for shared hosting environments, e.g. Webfaction
Python
6
star
26

django-de

The app that drives http://www.django-de.org
JavaScript
6
star
27

django-contact-form

This is here solely for legacy reasons. Don't use it. I don't support it.
Python
6
star
28

queues

Friendly fork of Matt Croydon's queues lib
Python
5
star
29

umap-dokku

Python
5
star
30

virtualmin-trac

A Virtualmin Pro install script that enables users to install Trac automatically
Perl
5
star
31

sublime-preferences

My Sublime Test 2 preferences
4
star
32

sphinxcontrib-embedly

This is a sphinx extension for using Embedly.
Python
4
star
33

django-locations

a location based social network using Django
Python
4
star
34

piwik-dokku

Nginx
4
star
35

django-openid

OpenID tools for Django
Python
4
star
36

snsz

Karte der Allgemeinverfügungen zu Schulschließungen oder eingeschränktem Regelbetrieb in Sachsen
Python
3
star
37

jzdz

A complete rip-off of bgk.me. Also a URL shortener.
Python
2
star
38

rq2test

Python
2
star
39

virtualmin-moinmoin

A Virtualmin Pro install script that enables users to install the MoinMoin wiki automatically
Perl
2
star
40

GeekTime.app

My humble PyObjC version of a Geek Time menu status app for OS X. Please fork and port it to proper ObjC. kthxbye
Python
2
star
41

isso-dokku

Python
1
star
42

pytuio

Automatically exported from code.google.com/p/pytuio
Python
1
star