aboutsummaryrefslogtreecommitdiff
path: root/files/ja/learn/server-side/django/skeleton_website/index.html
blob: 0d76ae46eb56138e611edc258b4a400b106fa6b5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
---
title: 'Django チュートリアル Part 2: スケルトンウェブサイトの作成'
slug: Learn/Server-side/Django/skeleton_website
tags:
  - django
  - イントロダクション
  - ガイド
  - チュートリアル
  - 初心者
  - 学習
  - 記事
translation_of: Learn/Server-side/Django/skeleton_website
---
<div>{{LearnSidebar}}</div>

<div>{{PreviousMenuNext("Learn/Server-side/Django/Tutorial_local_library_website", "Learn/Server-side/Django/Models", "Learn/Server-side/Django")}}</div>

<p class="summary"><a href="/ja/docs/Learn/Server-side/Django/Tutorial_local_library_website">Djangoチュートリアル</a> の2つ目の記事では、基本的なウェブサイトプロジェクトの「スケルトン」をどのように作っていくのかを説明します。サイト固有の設定、URL、モデル、ビュー、テンプレートを作成する方法について説明します。</p>

<table class="learn-box standard-table">
 <tbody>
  <tr>
   <th scope="row">前提条件:</th>
   <td><a href="/en-US/docs/Learn/Server-side/Django/development_environment">Django 開発環境の設定</a><a href="/en-US/docs/Learn/Server-side/Django/Tutorial_local_library_website">Djangoチュートリアル</a>を確認してください。</td>
  </tr>
  <tr>
   <th scope="row">目的:</th>
   <td>Djangoのツールを使って自分の新しいウェブサイトプロジェクトを開始できるようにする。</td>
  </tr>
 </tbody>
</table>

<h2 id="概要">概要</h2>

<p>この記事は、"スケルトン"ウェブサイトを作る方法を示します。そこにはサイト固有の設定、パス、モデル、ビューやテンプレートを組み込むことができるます。(これらについては後で述べます)</p>

<p>そのプロセスは単純です:</p>

<ol>
 <li><code style="font-style: normal; font-weight: normal; line-height: 1.5;">django-admin</code><span style="line-height: 1.5;"> ツールを使ってプロジェクトフォルダ、基本的なテンプレートファイル、プロジェクト管理スクリプト(</span><strong style="line-height: 1.5;">manage.py</strong><span style="line-height: 1.5;">)を作ります .</span></li>
 <li><strong style="line-height: 1.5;">manage.py</strong><span style="line-height: 1.5;"> は1つ以上のアプリケーションを作ります。</span>
  <div class="note">
  <p><strong>メモ</strong>: ウェブサイトは1つ以上のセクションから成ります。例えば、メインサイト、ブログ、ウィキ、ダウンロードエリアなど。Djangoは、これらのコンポーネントを別々のアプリケーションとして作成することを助けてくれます。それらは、必要なら異なるプロジェクトで再利用できます。</p>
  </div>
 </li>
 <li><span style="line-height: 1.5;">プロジェクトにアプリケーションを含めるために登録します。</span></li>
 <li><span style="line-height: 1.5;">url/path マッパーはそれらのアプリケーションを</span>結びつけます。</li>
</ol>

<p><a href="/en-US/docs/Learn/Server-side/Django/Tutorial_local_library_website">Local Library website</a> のために、ウェブサイトフォルダとプロジェクトフォルダは<em>locallibrary</em> という名前をつけます。また、1つのアプリケーションは<em>catalog</em>という名前をつけます。 したがって、最上位のフォルダ構成は以下のようになります。:</p>

<pre class="brush: bash"><em>locallibrary/         # Website folder</em>
    <strong>manage.py         </strong># Script to run Django tools for this project (created using django-admin)
    <em>locallibrary/     # Website/project folder </em>(created using django-admin)
    <em>catalog/          # Application folder </em>(created using manage.py)
</pre>

<p><span style="line-height: 1.5;">以下のセクションでは、その過程をもっと詳細に述べ、あなたが変更を試す方法を示しましょう。この記事の最後に、我々はいくつかの他のウェブサイトの設定について述べてみます。それはあなたがこのステージで行っていることかもしませんが。</span></p>

<h2 id="プロジェクトの作成">プロジェクトの作成</h2>

<p>始めにコマンドプロンプトまたはターミナルを開いて、(先に自分が仮想環境(<a href="/en-US/docs/Learn/Server-side/Django/development_environment#Using_a_virtual_environment">virtual environment</a>)にいることを確認して下さい)、Djangoアプリを格納したい場所へ移動します(ドキュメントフォルダの中など探しやすい場所にしましょう)。そして、新しいウェブサイトのフォルダ(この場合は<em> locallibrary</em><span style="line-height: 1.5;">を作りましょう。そして、cdコマンドでそのフォルダへ移動しましょう。</span></p>

<pre class="brush: bash">mkdir locallibrary
cd locallibrary</pre>

<p>以下のように、<code>django-admin startproject</code>コマンドで新しいプロジェクトを作り、そのフォルダの中に移動します。</p>

<pre class="brush: bash">django-admin startproject locallibrary
cd locallibrary</pre>

<p><code>django-admin</code>ツールは以下のようなフォルダ/ファイル構成を作ります。</p>

<pre class="brush: bash"><em>locallibrary/</em>
    <strong>manage.py</strong>
    <em>locallibrary/</em>
        settings.py
        urls.py
        wsgi.py</pre>

<p>我々の現在の作業ディレクトリはこのようなものになっているでしょう。</p>

<pre class="syntaxbox">../django_projects/locallibrary/</pre>

<p><em>locallibrary</em>プロジェクトのサブフォルダはこのウェブサイトに入口点となります: </p>

<ul>
 <li><strong>__init__.py </strong>は空ファイルであり、このディレクトリをPythonパッケージとして扱うように指示します。</li>
 <li><strong>settings.py</strong> はすべてのウェブサイトの設定を含んでいます。ここに、我々が作成した全てのアプリケーション、スタティックファイルの場所やデータベースの詳細設定などを登録します。</li>
 <li><strong>urls.py</strong> はサイトのurlとviewのマッピングを定義します。これは、すべてのurlマッピングコードを含むことができる一方で、いくつかのマッピングは特定のアプリケーションへ委任するのがより一般的です。 また後で分かるでしょう。<span style="line-height: 1.5;"> </span></li>
 <li><strong style="line-height: 1.5;">wsgi.py</strong><span style="line-height: 1.5;"> はあなたのDjangoアプリケーションがwebサーバと通信するのを助けてくれます。あなたはこれを定型として使うことができます。</span></li>
</ul>

<p><strong>manage.py</strong> スクリプトはアプリケーションを作成したり、データベースを操作したり、webサーバを起動したりするのに使われます。</p>

<h2 id="catalogアプリケーションの作成">catalogアプリケーションの作成</h2>

<p>次に、以下のコマンドを実行し、localibrary プロジェクトの中にアプリケーションを作りましょう。(このコマンドはプロジェクト内のmanage.pyと同じフォルダで実行する必要があります)</p>

<pre class="brush: bash">python3 manage.py startapp catalog</pre>

<div class="note">
<p><strong>メモ</strong>: 上記コマンドは LinuxやmacOS X用です。Windows のコマンドは: <code>py -3 manage.py startapp catalog</code></p>

<p>もしWindowsを使っているなら、このモジュール(manage.py)を使う際は<code>python3</code><code>py -3</code> に変更して下さい。</p>

<p>もしPython 3.7.0以降を使用しているなら、<code>py manage.py startapp catalog</code>で使用できます。</p>
</div>

<p>このツールは新しいフォルダを作成し、アプリケーションの様々なパーツとなるファイルをそのフォルダに追加します(以下の太字で表示)。 ほとんどのファイルは目的に応じて便利な名前が付けられており(例えば ビューは<strong>views.py</strong>に、モジュールは <strong>models.py</strong>に、テストは<strong>tests.py</strong>に、管理サイトの設定は <strong>admin.py</strong>に、アプリケーションの登録は<strong>apps.py</strong>に保存する必要がある)、 さらに、関連するオブジェクトを操作するための最低限の定型的なコードを用意している。</p>

<p>アップデートされた後のプロジェクトディレクトリはこのようになる:</p>

<pre class="brush: bash"><em>locallibrary/</em>
    manage.py
    <em>locallibrary/
</em><strong>    <em>catalog/</em>
        admin.py
        apps.py
        models.py
        tests.py
        views.py
        __init__.py
        <em>migrations/</em></strong>
</pre>

<p>加えて今持っているものは:</p>

<ul>
 <li>"マイグレーション"を格納するためのマイグレーションフォルダーモデルを変更した場合に自動的にデータベースの変更をするためのファイル</li>
 <li><strong>__init__.py</strong> — Django/Pythonがこのフォルダを <a href="https://docs.python.org/3/tutorial/modules.html#packages">Python Package</a> であると認識するためにここに作られた空のファイル。そうすることで、このオブジェクトは他のプロジェクトでも使用できる。</li>
</ul>

<div class="note">
<p><strong>メモ</strong>: 上記ファイルリストに何か欠けているものがあることに気づきましたか? ビューやモデルがある一方で、URLマッピング、テンプレート、静的ファイルの配置場所はありません。それらの作り方も以後説明します。(それらは全てのサイトで必須ではないですが、この例では必要になります。).</p>
</div>

<h2 id="catalogアプリケーションの登録">catalogアプリケーションの登録</h2>

<p>アプリケーションが作成されたので、ツールを実行するために(例えばデータベースにモデルを追加する)プロジェクトに登録する必要がある。 アプリケーションの登録はプロジェクトの設定で<code>INSTALLED_APPS</code> リストに加えることで行えます。</p>

<p>プロジェクトの設定ファイル <strong>locallibrary/locallibrary/settings.py</strong> を開いて、<code>INSTALLED_APPS</code> リストの定義を見つけましょう。そして、以下のようにリストの最後に新しい行を追加しましょう。</p>

<pre class="brush: bash">INSTALLED_APPS = [
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
<strong>    'catalog.apps.CatalogConfig', </strong>
]</pre>

<p>追加した新しい行はアプリケーションの構成オブジェクト(<code>CatalogConfig</code>) を指定しており、それはアプリケーション作成時に<strong>/locallibrary/catalog/apps.py</strong> によって生成されています。</p>

<div class="note">
<p><strong>メモ</strong>: すでにたくさんの他の<code>INSTALLED_APPS</code> (<code>MIDDLEWARE</code>も同様。設定ファイルのさらに下の方にあります)が存在していることに気づいたでしょう。これらは、<a href="/en-US/docs/Learn/Server-side/Django/Admin_site">Django administration site</a> をサポートすること可能にし、その結果、Djangoが使用するたくさんの機能(セッション、認証など)をサポートします。</p>
</div>

<h2 id="データベースの指定">データベースの指定</h2>

<p>これは、プロジェクトで使用するデータベースを特定する場所を指しています。— 開発と本番で動作のわずかな違いを避けるために、可能な限り同じデータベースを使用するのがよいでしょう。様々な<a href="https://docs.djangoproject.com/en/2.0/ref/settings/#databases">Databases</a> オプションを確認することができます(Django docs)。</p>

<p>この例では、SQLite データベースを使いましょう。なぜなら、デモンストレーションデータベースでは多くの同時アクセスを必要とせず、セットアップ作業に追加の作業が不要だからです。このデータベースがどのように設定されているかは <strong>settings.py</strong> で確認できます。 (詳細は以下にも記載しています):</p>

<pre class="brush: python">DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.sqlite3',
        'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
    }
}
</pre>

<p>SQLiteを使っているので、ここではこれ以上のセットアップは不要です。次へ移りましょう!</p>

<h2 id="その他のプロジェクト設定">その他のプロジェクト設定</h2>

<p><strong>settings.py</strong> ファイルは、ほかのいくつかの設定の構成にも使用されますが、この時点では <a href="https://docs.djangoproject.com/en/2.0/ref/settings/#std:setting-TIME_ZONE">TIME_ZONE</a> を変更するだけでよいでしょう。これは、tzデータベースタイムゾーンの標準リストの文字列を同じにする必要があります。(テーブルのTZ列に必要な値が含まれています) <code>TIME_ZONE</code> の値を、あなたのタイムゾーンに適した文字列に変更しましょう。<br>
 例を示します:</p>

<pre class="brush: python">TIME_ZONE = 'Europe/London'</pre>

<p>今は変更しないが、次の2つの設定があることに注意してください。</p>

<ul>
 <li><code>SECRET_KEY</code>. これは、Djangoのセキュリティ対策の一つとして使用される秘密鍵である。開発中にこのコードを保護していない場合は、運用環境へ配置する際は別のコード(おそらく環境変数かファイルから読み込む)を使う必要があります。</li>
 <li><code>DEBUG</code>. これは、エラー時にHTTPステータスコードの応答ではなく、デバッグログを表示させます。運用環境では、攻撃者にとって有効なデバッグ情報は <code>False</code> にしておくべきです。しかし、今は<code>True</code>のままにしておきましょう。</li>
</ul>

<h2 id="URLマッパーの接続">URLマッパーの接続</h2>

<p>Webサイトは、プロジェクトフォルダー内のURLマッパーファイル(urls.py)で作成されます。このファイルを使用してすべてのURLマッピングを管理できますが、関連付けられたアプリケーションへマッピングを延ばすのがより一般的です。</p>

<p> <strong>locallibrary/locallibrary/urls.py</strong> を開いて、URLマッパーを使うためのいくつかの方法を記した説明文に注意してください。</p>

<pre class="brush: python">"""locallibrary URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/2.0/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  path('', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.urls import include, path
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.urls import path

urlpatterns = [
    path('admin/', admin.site.urls),
]
</pre>

<p>The URL mappings are managed through the <code>urlpatterns</code> variable, which is a Python <em>list</em> of <code>path()</code> functions. Each <code>path()</code> function either associates a URL pattern to a <em>specific view</em>, which will be displayed when the pattern is matched, or with another list of URL pattern testing code (in this second case, the pattern becomes the "base URL" for patterns defined in the target module). The <code>urlpatterns</code> list initially defines a single function that maps all URLs with the pattern <em>admin/</em> to the module <code>admin.site.urls</code> , which contains the Administration application's own URL mapping definitions.</p>

<div class="note">
<p><strong>Note</strong>: The route in <code>path()</code> is a string defining a URL pattern to match. This string might include a named variable (in angle brackets), e.g. <code>'catalog/&lt;id&gt;/'</code>. This pattern will match a URL like <strong>/catalog/</strong><em>any_chars</em><strong>/</strong> and pass <em>any_chars</em> to the view as a string with parameter name <code>id</code>). We discuss path methods and route patterns further in later topics.</p>
</div>

<p>Add the lines below to the bottom of the file in order to add a new list item to the <code>urlpatterns</code> list. This new item includes a <code>path()</code> that forwards requests with the pattern <code>catalog/</code> to the module <code>catalog.urls</code> (the file with the relative URL <strong>/catalog/urls.py</strong>).</p>

<pre class="brush: python"># Use include() to add paths from the catalog application
from django.conf.urls import include
from django.urls import path

urlpatterns += [
    path('catalog/', include('catalog.urls')),
]
</pre>

<p>Now let's redirect the root URL of our site (i.e. <code>127.0.0.1:8000</code>) to the URL <code>127.0.0.1:8000/catalog/</code>; this is the only app we'll be using in this project, so we might as well. To do this, we'll use a special view function (<code>RedirectView</code>), which takes as its first argument the new relative URL to redirect to (<code>/catalog/</code>) when the URL pattern specified in the <code>path()</code> function is matched (the root URL, in this case).</p>

<p>Add the following lines, again to the bottom of the file:</p>

<pre class="brush: python">#Add URL maps to redirect the base URL to our application
from django.views.generic import RedirectView
urlpatterns += [
    path('', RedirectView.as_view(url='/catalog/')),
]</pre>

<p>Leave the first parameter of the path function empty to imply '/'. If you write the first parameter as '/' Django will give you the following warning when you start the development server:</p>

<pre class="brush: python">System check identified some issues:

WARNINGS:
?: (urls.W002) Your URL pattern '/' has a route beginning with a '/'.
Remove this slash as it is unnecessary.
If this pattern is targeted in an include(), ensure the include() pattern has a trailing '/'.
</pre>

<p>Django does not serve static files like CSS, JavaScript, and images by default, but it can be useful for the development web server to do so while you're creating your site. As a final addition to this URL mapper, you can enable the serving of static files during development by appending the following lines. </p>

<p>Add the following final block to the bottom of the file now:</p>

<pre><code># Use static() to add url mapping to serve static files during development (only)
from django.conf import settings
from django.conf.urls.static import static

urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)</code>
</pre>

<div class="note">
<p><strong>Note</strong>: There are a number of ways to extend the <code>urlpatterns</code> list (above we just appended a new list item using the <code>+=</code> operator to clearly separate the old and new code). We could have instead just included this new pattern-map in the original list definition:</p>

<pre class="brush: python">urlpatterns = [
    path('admin/', admin.site.urls),
    path('catalog/', include('catalog.urls')),
    path('', RedirectView.as_view(url='/catalog/', permanent=True)),
] + <code>static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)</code>
</pre>

<p>In addition, we included the import line (<code>from django.urls import include</code>) with the code that uses it (so it is easy to see what we've added), but it is common to include all your import lines at the top of a Python file.</p>
</div>

<p>As a final step, create a file inside your catalog folder called <strong>urls.py</strong>, and add the following text to define the (empty) imported <code>urlpatterns</code>. This is where we'll add our patterns as we build the application. </p>

<pre class="brush: python">from django.urls import path
from . import views


urlpatterns = [

]
</pre>

<h2 id="ウェブサイトフレームワークのテスト">ウェブサイトフレームワークのテスト</h2>

<p>At this point we have a complete skeleton project. The website doesn't actually <em>do</em> anything yet, but its worth running it to make sure that none of our changes have broken anything. </p>

<p>Before we do that, we should first run a <em>database migration</em>. This updates our database to include any models in our installed applications (and removes some build warnings).</p>

<h3 id="Running_database_migrations">Running database migrations</h3>

<p>Django uses an Object-Relational-Mapper (ORM) to map Model definitions in the Django code to the data structure used by the underlying database. As we change our model definitions, Django tracks the changes and can create database migration scripts (in <strong>/locallibrary/catalog/migrations/</strong>) to automatically migrate the underlying data structure in the database to match the model.</p>

<p>When we created the website Django automatically added a number of models for use by the admin section of the site (which we'll look at later). Run the following commands to define tables for those models in the database (make sure you are in the directory that contains<strong> manage.py</strong>):</p>

<pre class="brush: bash">python3 manage.py makemigrations
python3 manage.py migrate
</pre>

<div class="warning">
<p><strong>Important</strong>: You'll need to run the above commands every time your models change in a way that will affect the structure of the data that needs to be stored (including both addition and removal of whole models and individual fields).</p>
</div>

<p>The <code>makemigrations</code> command <em>creates</em> (but does not apply) the migrations for all applications installed in your project (you can specify the application name as well to just run a migration for a single project). This gives you a chance to checkout the code for these migrations before they are applied — when you're a Django expert you may choose to tweak them slightly!</p>

<p>The <code>migrate</code> command actually applies the migrations to your database (Django tracks which ones have been added to the current database).</p>

<div class="note">
<p><strong>Note</strong>: See <a href="https://docs.djangoproject.com/en/2.0/topics/migrations/">Migrations</a> (Django docs) for additional information about the lesser-used migration commands.</p>
</div>

<h3 id="Running_the_website">Running the website</h3>

<p>During development you can test the website by first serving it using the <em>development web server</em>, and then viewing it on your local web browser. </p>

<div class="note">
<p><strong>Note</strong>: The development web server is not robust or performant enough for production use, but it is a very easy way to get your Django website up and running during development to give it a convenient quick test. By default it will serve the site to your local computer (<code>http://127.0.0.1:8000/)</code>, but you can also specify other computers on your network to serve to. For more information see <a href="https://docs.djangoproject.com/en/2.0/ref/django-admin/#runserver">django-admin and manage.py: runserver</a> (Django docs).</p>
</div>

<p>Run the <em>development web server</em> by calling the <code>runserver</code> command (in the same directory as <strong>manage.py</strong>):</p>

<pre class="brush: bash">python3 manage.py runserver

 Performing system checks...

 System check identified no issues (0 silenced).
 September 22, 2016 - 16:11:26
 Django version 1.10, using settings 'locallibrary.settings'
 Starting development server at http://127.0.0.1:8000/
 Quit the server with CTRL-BREAK.
</pre>

<p>Once the server is running you can view the site by navigating to <code>http://127.0.0.1:8000/</code> in your local web browser. You should see a site error page that looks like this:</p>

<p><img alt="Django Debug page for Django 2.0" src="https://mdn.mozillademos.org/files/15729/django_404_debug_page.png"></p>

<p>Don't worry! This error page is expected because we don't have any pages/urls defined in the <code>catalogs.urls</code> module (which we're redirected to when we get an URL to the root of the site). </p>

<div class="note">
<p><strong>Note</strong>: The above page demonstrates a great Django feature — automated debug logging. An error screen will be displayed with useful information whenever a page cannot be found, or any error is raised by the code. In this case we can see that the URL we've supplied doesn't match any of our URL patterns (as listed). The logging will be turned off during production (when we put the site live on the Web), in which case a less informative but more user-friendly page will be served.</p>
</div>

<p>At this point we know that Django is working! </p>

<div class="note">
<p><strong>Note</strong>: You should re-run migrations and re-test the site whenever you make significant changes. It doesn't take very long!</p>
</div>

<h2 id="自分でやってみよう">自分でやってみよう</h2>

<p>The <strong>catalog/</strong> directory contains files for the views, models, and other parts of the application. Open these files and inspect the boilerplate. </p>

<p>As you saw above, a URL-mapping for the Admin site has already been added in the project's <strong>urls.py</strong>. Navigate to the admin area in your browser and see what happens (you can infer the correct URL from the mapping above).</p>

<ul>
</ul>

<h2 id="要約">要約</h2>

<p>You have now created a complete skeleton website project, which you can go on to populate with urls, models, views, and templates.</p>

<p>Now the skeleton for the <a href="/en-US/docs/Learn/Server-side/Django/Tutorial_local_library_website">Local Library website</a> is complete and running, it's time to start writing the code that makes this website do what it is supposed to do. </p>

<h2 id="参考文献">参考文献</h2>

<ul>
 <li><a href="https://docs.djangoproject.com/en/2.0/intro/tutorial01/">Writing your first Django app - part 1</a>  (Django docs)</li>
 <li><a href="https://docs.djangoproject.com/en/2.0/ref/applications/#configuring-applications">Applications</a> (Django Docs). Contains information on configuring applications.</li>
</ul>

<p>{{PreviousMenuNext("Learn/Server-side/Django/Tutorial_local_library_website", "Learn/Server-side/Django/Models", "Learn/Server-side/Django")}}</p>

<h2 id="このモジュール内">このモジュール内</h2>

<ul>
 <li><a href="/en-US/docs/Learn/Server-side/Django/Introduction">Django introduction</a></li>
 <li><a href="/en-US/docs/Learn/Server-side/Django/development_environment">Setting up a Django development environment</a></li>
 <li><a href="/en-US/docs/Learn/Server-side/Django/Tutorial_local_library_website">Django Tutorial: The Local Library website</a></li>
 <li><a href="/en-US/docs/Learn/Server-side/Django/skeleton_website">Django Tutorial Part 2: Creating a skeleton website</a></li>
 <li><a href="/en-US/docs/Learn/Server-side/Django/Models">Django Tutorial Part 3: Using models</a></li>
 <li><a href="/en-US/docs/Learn/Server-side/Django/Admin_site">Django Tutorial Part 4: Django admin site</a></li>
 <li><a href="/en-US/docs/Learn/Server-side/Django/Home_page">Django Tutorial Part 5: Creating our home page</a></li>
 <li><a href="/en-US/docs/Learn/Server-side/Django/Generic_views">Django Tutorial Part 6: Generic list and detail views</a></li>
 <li><a href="/en-US/docs/Learn/Server-side/Django/Sessions">Django Tutorial Part 7: Sessions framework</a></li>
 <li><a href="/en-US/docs/Learn/Server-side/Django/Authentication">Django Tutorial Part 8: User authentication and permissions</a></li>
 <li><a href="/en-US/docs/Learn/Server-side/Django/Forms">Django Tutorial Part 9: Working with forms</a></li>
 <li><a href="/en-US/docs/Learn/Server-side/Django/Testing">Django Tutorial Part 10: Testing a Django web application</a></li>
 <li><a href="/en-US/docs/Learn/Server-side/Django/Deployment">Django Tutorial Part 11: Deploying Django to production</a></li>
 <li><a href="/en-US/docs/Learn/Server-side/Django/web_application_security">Django web application security</a></li>
 <li><a href="/en-US/docs/Learn/Server-side/Django/django_assessment_blog">DIY Django mini blog</a></li>
</ul>