per page, with , order by , clip by
Results of 1 - 10 of about 61 for static (0.038 sec.)
静的ファイル (画像、JavaScript、CSS など) を管理する 12959
静的ファイル (画像、JavaScript、CSS など) を管理する Websites generally need to serve additional files such as images, JavaScript, or CSS. In Django, we refer to these files as "static files". Django provides django.contrib.staticfiles to h ... lp you manage them. このページでは、こうした静的ファイルの配信の仕方について説明します。 静的ファイルの設定 django.contrib.staticfiles が設定ファイルの INSTALLED_APPS に含まれていることを確認してください。 設定ファイルの中で、 STATIC_URL を設定します。 ... たとえば、次のようにします: STATIC_URL = "static/" テンプレート内では、 static テンプレートタグを使用して、 staticfiles STORAGES で設定したエイリアスで相対パ ... スの URL を生成できます。 {% load static %} < img src = " {% static 'my_app/example.jpg' %} " alt = "My image" > アプリ内に static というフォルダを作成って静的ファ ...
https://man.mtool.work/django/6.1/howto/static-files/
フォームアセット (Media クラス) 12712
フォームアセット ( Media クラス) 魅力的で使いやすいウェブのフォームを作るには、HTML だけでは不十分です。CSS スタイルシートも必要です。さらに豪華なウィジェットを使いたければ、JavaScript を各ページに配置する必要もあるでしょう。あるページに必要 ... スのアセットリストは、このプロパティから取得できます: >>> w = CalendarWidget () >>> print ( w . media ) <link href="https://static.example.com/pretty.css" media="all" rel="stylesheet"> <script src="https://static.example.com/animations.js"></script> <sc ... ript src="https://static.example.com/actions.js"></script> 以下は指定可能な Media オプションです。必須のものはありません。 css 様々な形式の出力メデ ... s" ], "print" : [ "newspaper.css" ], } 上記のCSS定義をレンダリングすると、次のようなHTMLになります: < link href = "https://static.example.com/pretty.css" media = "screen" rel = "stylesheet" > < link href = "https://static.example.com/lo_res.css" media ...
https://man.mtool.work/django/6.1/topics/forms/media.html
staticfiles アプリ 12277
staticfiles アプリ django.contrib.staticfiles は、各アプリケーション(と、あらかじめ指定した他の場所)から静的ファイルを収集し、本番環境で簡単に提供できるように一か所にまとめます。 参考 静的ファイルアプリの導入と活用例については、 静的ファイ ... ルをデプロイする を参照してください。 設定 次の設定に関する詳細については、 静的ファイルの設定 を参照してください。 STORAGES STATIC_ROOT STATIC_URL STATICFILES_DIRS STATICFILES_FINDERS 管理コマンド django.contrib.staticfiles は3つの管理コマンドを提供しま ... す。 collectstatic django-admin collectstatic 静的ファイルを STATIC_ROOT に収集します。 デフォルトでは、重複するファイル名はテンプレートの解決 ... すなわち、指定された場所のいずれかで最初に見つかったファイルが使用されます。どのファイルが反映されたかわからない場合は、 findstatic コマンドを使用して、どのファイルが適用されたかを確認できます。 その後、再度 collectstatic を実行すると、( STATIC_ROOT が空 ...
https://man.mtool.work/django/6.1/ref/contrib/staticfiles.html
はじめての Django アプリ作成、その 6 11016
はじめての Django アプリ作成、その 6 このチュートリアルは チュートリアル 5 の続きです。Web 投票アプリケーションのテストが完成したので、今度はスタイルシートや画像を追加しましょう。 サーバで生成するHTML以外に、Webアプリケーションは一般的に完全 ... ンダリングするために、画像、JavaScript、CSSなど必要なファイルを提供する必要があります。Djangoでは、これらのファイルを "静的 (static) ファイル" と呼びます。 小さなプロジェクトではこのことは大きな問題になりません。 ウェブサーバが見つけられる場所で静的ファイ ... なる場合は、各アプリケーションが 持っている静的ファイルの集まりを複数扱うことになり、ややこしくなってきます。 django.contrib.staticfiles はまさにそのためにあります。これは静的なファイルを各アプリケーションから (さらに指定した別の場所からも) 一つの場所に集 ... Getting Help セクションに進んでください。 アプリ のルック & フィールをカスタマイズする 最初に、 polls ディレクトリの中に、 static ディレクトリを作成します。Django はそこから静的ファイルを探します。Django が polls/templates/ からテンプレートを探す方法と ...
https://man.mtool.work/django/6.1/intro/tutorial06.html
Django を Apache と mod_wsgi とともに使うには? 8827
Django を Apache と mod_wsgi とともに使うには? Apache と mod_wsgi と共にDjangoをデプロイすることは、Djangoを製品とする際に試され、テストされた方法です。 mod_wsgi は、Djangoを含む任意のPythonの WSGI アプリケーションをホストできるApacheのモジ ... イスとして設定することができます。 この例では、サイトのルートには Django を設定していますが、 robots.txt 、 favicon.ico 、 /static/ 、そして /media/ の URL 空間は静的ファイルとして配信しています。他のすべての URL は mod_wsgi を使用して配信されます。 Ali ... as /robots.txt /path/to/mysite.com/static/robots.txt Alias /favicon.ico /path/to/mysite.com/static/favicon.ico Alias /media/ /path/to/mysite.com/media/ Alias /stati ... c/ /path/to/mysite.com/static/ <Directory /path/to/mysite.com/static > Require all granted </Directory> <Directory /path/to/mysite.com/media > Require a ...
https://man.mtool.work/django/6.1/howto/deployment/wsgi/modwsgi.html
静的ファイルをデプロイする 8726
静的ファイルをデプロイする 参考 django.contrib.staticfiles の使い方の基本に関しては、 静的ファイル (画像、JavaScript、CSS など) を管理する を読んでください。 本番環境における静的ファイルの配信 本番環境で静的ファイルを配置する基本的な手順は、 ... 次の2ステップからなります。まず、静的ファイルが変更されたときに collectstatic コマンドを実行します。その後、収集された静的ファイルのディレクトリ ( STATIC_ROOT ) を静的ファイルサーバーに移動し、配信でき ... るようにします。 staticfiles の STORAGES エイリアスに応じて、ファイルを手動で新しい場所に移動しなければならないこともありますが、 Storage クラスの ... 更する必要があります。以下に、役立つかもしれないいくつかの一般的なパターンを示します。 Having your Django application serve static files While web servers are much better and faster at serving static files, it is possible to have Django serve them using ...
https://man.mtool.work/django/6.1/howto/static-files/deployment.html
Django 1.4 リリースノート 8247
Django 1.4 リリースノート March 23, 2012 Django 1.4 へようこそ! These release notes cover the new features , as well as some backwards incompatible changes you'll want to be aware of when upgrading from Django 1.3 or older versions. We've a ... cated strings end with a translatable ellipsis sequence ("..."). See the documentation for truncatechars for more details. static template tag The staticfiles contrib app has a new static template tag to refer to files saved with the STATICFILES_STORAG ... e storage backend's url method and therefore supports advanced features such as serving files from a cloud service . CachedStaticFilesStorage storage backend The staticfiles contrib app now has a django.contrib.staticfiles.storage.CachedStaticFilesStor ... age backend that caches the files it saves (when running the collectstatic management command) by appending the MD5 hash of the file's content to the filename. For example, the file css/styles.css ...
https://man.mtool.work/django/6.1/releases/1.4.html
Django 1.3 リリースノート 8103
Django 1.3 リリースノート March 23, 2011 Django 1.3 へようこそ! Nearly a year in the making, Django 1.3 includes quite a few new features and plenty of bug fixes and improvements to existing features. These release notes cover the new featu ... writing class-based views . Built-in support for using Python's logging facilities . Contrib support for easy handling of static files . Django's testing framework now supports (and ships with a copy of) the unittest2 library . Wherever possible, new ... rror are now handled as a logging activity. See the documentation on Django's logging interface for more details. Extended static files handling Django 1.3 ships with a new contrib app -- django.contrib.staticfiles -- to help developers handle the stat ... S, JavaScript, etc.) that are needed to render a complete web page. In previous versions of Django, it was common to place static assets in MEDIA_ROOT along with user-uploaded files, and serve them both at MEDIA_URL . Part of the purpose of introducing ...
https://man.mtool.work/django/6.1/releases/1.3.html
組み込みテンプレートタグとフィルタ 8001
組み込みテンプレートタグとフィルタ このドキュメントでは、 Django の組み込みテンプレートタグとフィルタについて述べます。 また 自動ドキュメンテーション を使えばインストールされている組み込みタグとカスタムタグのドキュメントを読めるのでお勧めで ... しい」表現にする上で便利な Django テンプレートフィルタのセットです。くわしくは django.contrib.humanize を参照してください。 static static STATIC_ROOT に保存されている静的ファイルにリンクするために、 Django には static テンプレートタグが同梱されています。 ... django.contrib.staticfiles アプリケーションがインストールされていれば、このタグは STORAGES で staticfiles で指定されたストレージの url() メソッド ... を使ってファイルを配信します。たとえば以下のようにします: {% load static %} < img src = " {% static 'images/hi.jpg' %} " alt = "Hi!" > 普通のコンテキスト変数を使うこともできます。例えば user_styl ...
https://man.mtool.work/django/6.1/ref/templates/builtins.html
URLconf で使用するための django.urls 関数 7958
URLconf で使用するための django.urls 関数 path() path ( route , view , kwargs = None , name = None ) urlpatterns に含める要素を返します。例えば: from django.urls import include , path urlpatterns = [ path ( "index/" , views . index , name = ... ー名です。例については 独自のパスコンバータを登録する を参照してください。 URLconf で使用するための django.conf.urls の関数 static() static. static ( prefix , view = django.views.static.serve , ** kwargs ) デバッグモードでファイルを配信するための URL パ ... ターンを返すヘルパー関数です: from django.conf import settings from django.conf.urls.static import static urlpatterns = [ # ... the rest of your URLconf goes here ... ] + static ( settings . MEDIA_URL , document_ro ...
https://man.mtool.work/django/6.1/ref/urls.html
PREV 1 2 3 4 5 6 7 NEXT