Uploading Files On Tumblr
I'm sure this is common knowledge among power users, but you can host media directly on tumblr like on Github:

seen from China

seen from Sweden

seen from United States
seen from China
seen from China
seen from Russia

seen from Malaysia
seen from China

seen from Singapore
seen from Philippines
seen from United States
seen from Sweden
seen from Hong Kong SAR China
seen from United Kingdom
seen from Italy
seen from China

seen from Italy
seen from United States
seen from Maldives
seen from Sweden
Uploading Files On Tumblr
I'm sure this is common knowledge among power users, but you can host media directly on tumblr like on Github:
Gjango, Pycharm - static files Windows
Gjango, Pycharm – static files Windows
This topic for those who broke his mind trying to understand how to make Pycharm run Django with static files I’ve made it, but be carefull it can broke your mind too! The settings I use the most portable way to configure settings – so I can move it into centos web server without paths changes Win\Unix (I HOPE). There are common DIRs BASE_DIR =…
View On WordPress
Entendendo a relação entre o Django e arquivos estáticos
ótimo artigo do Henrique Bastos sobre arquivos estáticos no Django, vale a pena estudar:
http://henriquebastos.net/entendendo-a-relacao-entre-o-django-e-arquivos-estaticos/
Ver Post
Django com Twitter Bootstrap
Fala galera, Neste post quero fazer um passo-a-passo de como usar o “Twitter Bootstrap” em um…
View Post
Arquivos estatísticos no Django de forma mais nativa possivel
Recentemente abri uma discussão no grupo “Django Brasil” [1] sobre arquivos estáticos no Django de…
View Post
[Django]staticfilesの使い方
Django1.3から`django.contrib.staticfiles` というアプリが増えた。 それ以前のバージョンには、`settings.MEDEA_ROOT`という設定があったが、これは静的ファイルもユーザーがアップロードしたファイル(FileFieldで定義された保存先等)も同一ディレクトリに保存されていた。 javascriptやCSSといった静的ファイルを別ディレクトリで管理できるようにする仕組み。 ### 使いどころ 開発時にはアプリ毎のディレクトリで静的ファイルを管理しておいて、本番環境ではアプリ毎の静的ファイルを集約して、ApacheなどのWebサーバにお任せする。 ## テスト用サンプルアプリの作成 コマンドで雛形作成。 # django-admin.py startproject mysite # python manage.py statrapp myapp 以下のような構成になるはず mysite/ myapp/ __init__.py models.py tests.py views.py __init__.py manage.py settings.py urls.py ### settings.py を編集 DBの設定とかは割愛。以下に関係ある設定だけ記載。 プロジェクトのディレクトリを設定しとくと後で楽。 import os PROJECT_PATH = os.path.realpath(os.path.dirname(__file__)) #### settings.INSTALLED_APPSの編集 INSTALLED_APPS = ( 'django.contrib.staticfiles', ) 元から設定されてるはず。 #### settings.STATIC_URLの編集 静的ファイルにアクセスする時のURL prefix を設定する。 STATIC_URL = '/static/' 上記は、/static/XXX.css などで静的ファイルへアクセスできるような設定例 #### settings.STATICFILES_FINDERSの編集 STATICFILES_FINDERS = ( 'django.contrib.staticfiles.finders.FileSystemFinder', 'django.contrib.staticfiles.finders.AppDirectoriesFinder', # 'django.contrib.staticfiles.finders.DefaultStorageFinder', ) * `FileSystemFinder`は`settings.STATICFILES_DIRS`に設定されたディレクトリから静的ファイルを検索する。 * `AppDirectoriesFinder`はアプリケーション毎の`static`という名称のディレクトリを検索する。 * `DefaultStorageFinder`は`settings.DEFAULT_FILE_STORAGE`バックエンドの設定に沿って検索 #### settings.STATICFILES_DIRSの編集 FileSystemFinder でファイルの検索先となるディレクトリを指定するための設定。 今回はprojectstaticディレクトリをプロジェクト直下に作成して以下の設定を追加。 STATICFILES_DIRS = ( os.path.join(PROJECT_PATH, 'projectstatic'), ) ### アプリケーションにstaticディレクトリを作成。 myappディレクトリにstaticディレクトリを作成する。 ### テスト用ファイルを保存 projectstatic ディレクトリとstaticディレクトリに「A.jpg」と「B.jpg」をテスト用に保存。 最終的なディレクトリ構成は以下のようになった。 mysite/ myapp/ static/ B.jpg __init__.py models.py tests.py views.py projectstatic/ A.jpg __init__.py manage.py settings.py urls.py ## runserverコマンド runserverコマンドを利用すると、/static/以下のURLが自動的に有効化されて起動される。 `--nostatic`オプションをつけて起動すると、/static/以下のURLは無効化される。 ※ただし、DEBUG=Trueの時のみ。 python manage.py runserver --nostatic `--nostatic`オプションを付けても、静的ファイルを有効にしておきたい場合はurls.pyのurlpatterns最後尾に以下を追記しとく。 urls.py urlpatterns = patterns('', url(r'^', include('django.contrib.staticfiles.urls')), ) 試しに引数なしのrunserverコマンドでテストサーバーを起動させてアクセス。 http://localhost:8000/static/A.jpg http://localhost:8000/static/B.jpg 二つとも画像が表示されれば設定できてる。 ### テンプレートでの使用方法 `STATIC_URL` タグを利用する。 ただし、settingsに以下の設定が必要。(デフォルトで有効化されてるはず。) TEMPLATE_CONTEXT_PROCESSORS = ( 'django.core.context_processors.static', ) ## 本番環境へのデプロイ方法 今までの設定は、settings.DEBUG=True の状態でしか作動しない。 また、本番環境ではrunserver コマンドは利用せず、ApacheなどのWebサーバー等を利用するはずなので、Webサーバ側に静的ファイルの管理を任せるように設定する。 `django-admin.py collectstatic` コマンドは静的ファイルを1箇所に集約してくれるコマンド。 集約する場所は`settings.STATIC_ROOT ` に設定した箇所に集約してくれる。 ### settings.STATIC_ROOT の編集 STATIC_ROOT = os.path.join(PROJECT_PATH, 'static') プロジェクトディレクトリ直下のstaticディレクトリに集約するように設定した。 ### collectstaticコマンドのコール python manage.py collectstatic これで、staticディレクトリにプロジェクト以下の静的ファイルがコピーされる。 上書きされてしまうので注意が必要。 ### Webサーバの設定 Apacheであれば、先程のstaticディレクトリをAliasディレクティブなどで設定すればOK Alias /static/ /home/mysite/static/ Order deny,allow Allow from all