本文へスキップ
製品デスクトップツールTASTECAD図面の確認TASTEFILESファイル管理TASTEFTPファイル転送TASTESSHリモートワークスペースTASTEZIP圧縮と展開TASTEWINMファイル管理開発ツールTASTECODERust 統合開発環境TASTESTUDIO統合開発・テスト環境TASTEETLデータ統合(ETL)サーバーTASTEREMOTEリモートデスクトップサーバーTASTEGEO空間情報サーバーTASTEMAILメールワークスペース投資TASTESTOCK株式自動売買デスクトップアプリはじめるダウンロードドキュメント購入すべての製品
マーケットプレイス
ニュース
技術ニュース今日の開発ニュース開発ドキュメントプログラミング言語RustTypeScriptJavaScriptPythonGoC#JavaCC++KotlinDartWebフロントエンド フレームワークNext.jsReactVue.js · NuxtSvelteKitAngularサーバー フレームワークSpring BootDjangoFastAPIASP.NET CoreNestJS · Expressアプリ・デスクトップ フレームワークTauriFlutterReact NativeElectronアルゴリズムアルゴリズムの基礎主要アルゴリズム発展アルゴリズム実務のアルゴリズム
コミュニティプロジェクト開発ログプロンプトAIツールの問題ショーケースコミュニティガイド
協業技術移転ウェブサイト構築デスクトップアプリ構築リリース・決済パイプライン販売パートナーお問い合わせ
サービスリモートデスクトップインストールパッケージのカスタマイズ
TASTEDEV
製品

デスクトップツール

TASTECAD複雑な図面を、軽やかにひらくTASTEFILES必要なファイルだけを、最速でTASTEFTPファイルが行き交う、いちばん端正な道TASTESSHサーバーとあなたを、より確かにつなぐTASTEZIPより速くまとめ、より安全にひらくTASTEWINM2つの画面で整理する、キーボード中心のファイルマネージャー

開発ツール

TASTECODERust アプリの編集・ビルド・デバッグ・テストまでひとつのウィンドウでTASTESTUDIO編集からリモートテスト、承認した AI 修正までTASTEETL値を見ながら、データを運ぶ

サーバー

TASTEREMOTE自社サーバーで運用するリモートデスクトップTASTEGEOGeoServer 互換の空間情報サーバーを Rust で作り直しますTASTEMAILメールの主導権を、もう一度自分の手に

投資

TASTESTOCKいつ・何を。自分で決めたルールどおりに動く株式自動売買

はじめる

ダウンロード全製品の最新版ドキュメント各製品の使い方購入サブスクリプション・永久ライセンスすべての製品全製品を一覧で
すべての製品
マーケットプレイスニュース
技術

ニュース

今日の開発ニュース言語・フレームワーク・GitHub・AI の公式発表開発ドキュメント言語・フレームワーク・アルゴリズムのガイド

プログラミング言語

RustTypeScriptJavaScriptPythonGoC#JavaCC++KotlinDart

フレームワーク

Webフロントエンド フレームワークNext.jsReactVue.js · NuxtSvelteKitAngular
サーバー フレームワークSpring BootDjangoFastAPIASP.NET CoreNestJS · Express
アプリ・デスクトップ フレームワークTauriFlutterReact NativeElectron

アルゴリズム

アルゴリズムの基礎計算量解析 · ソート · 探索 · 基本データ構造 · 木構造とヒープ主要アルゴリズムグラフ探索 · 最短経路と最小全域木 · 動的計画法 · 貪欲法 · 分割統治法 · バックトラッキング発展アルゴリズム文字列アルゴリズム · 数学と整数論 · ビット演算 · セグメント木 · Union-Find実務のアルゴリズムコーディング面接対策 · LRUキャッシュ · レート制限 · コンシステントハッシュ法
開発ドキュメントをすべて見る
コミュニティ
プロジェクトビルダーと作品を探す開発ログ決定と試行錯誤プロンプト再利用できる指示AIツールの問題Claude・Codex・Gemini の問題と回避策ショーケース完成した成果コミュニティガイドオープンにつくる方法
協業
技術移転Rust・egui でネイティブアプリを作るウェブサイト構築10言語、アカウント、ドキュメントとダウンロードデスクトップアプリ構築Rust・egui、WebView なしリリース・決済パイプライン署名・MSI・deb・rpm・AppImage・ハッシュ販売パートナー紹介して決済額の30%お問い合わせ構築・提携・投資のご相談
サービス
リモートデスクトップブラウザから自分のパソコンへインストールパッケージのカスタマイズ必要な機能だけ、設定は事前に
購入
JA
한국어EnglishDeutschEspañolFrançaisItalianoPortuguês (Brasil)日本語简体中文繁體中文
ログイン
ログイン
TASTEDEV

小さなツールから、より良い開発へ。

support@tastedev.netTASTEDEVを支援
製品製品ラインナップ購入ドキュメントダウンロードマーケットプレイスサポート
コミュニティプロジェクト開発ログプロンプトAIツールの問題ショーケース
ポリシー会社概要プライバシーポリシー利用規約サブスクリプション規約返金ポリシーコミュニティガイドライン
アカウントログイン新規登録
訪問者
今日
昨日
累計閲覧
商号
GXSOFT
代表者
CHOI YOUNG GU
事業者登録番号
853-44-00368
所在地
9F V24, 351 Gyeongin-ro, Michuhol-gu, Incheon, Republic of Korea
電話
+82-10-4404-1523
メール
whitecalvin@tastedev.net
個人情報保護責任者
CHOI YOUNG GU

© 2026 TASTEDEV製品情報は検証済みの開発ソースに基づいています。リリース・改善中

Django ドキュメント
Django
Getting Started with DjangoProject StructureCore ConceptsData and StateTestingDeployment
ディスカッション

Django ガイド · 2/6

Project Structure

この章は現在、英語でのみ提供しています。

Django projects follow a predictable layout and a handful of naming conventions. Once you know them, you can open almost any Django codebase and find your way around quickly. This chapter covers the files in a project and an app, the settings module, and the conventions most teams follow.

Project and app files

Running django-admin startproject mysite . and python manage.py startapp polls gives you this layout:

mysite-project/
    manage.py
    mysite/
        __init__.py
        settings.py
        urls.py
        asgi.py
        wsgi.py
    polls/
        __init__.py
        admin.py
        apps.py
        models.py
        tests.py
        views.py
        migrations/
            __init__.py
FilePurpose
manage.pyEntry point that loads your settings and runs management commands
mysite/settings.pyAll configuration: database, installed apps, middleware and more
mysite/urls.pyThe root URL configuration (URLconf)
mysite/wsgi.py, mysite/asgi.pyWSGI and ASGI entry points loaded by production servers
polls/models.pyData models
polls/views.pyViews that handle requests
polls/admin.pyRegisters models with the admin site
polls/apps.pyThe app's configuration class (AppConfig)
polls/migrations/Migration files that record model changes
polls/tests.pyTests

startapp does not create urls.py, forms.py, templates/ or static/; add them when you need them.

Where templates and static files live

By default Django looks for files in each app's templates/ and static/ folders. To avoid name clashes between apps, the convention is to nest them in one more folder named after the app.

polls/
    templates/
        polls/
            index.html
            detail.html
    static/
        polls/
            style.css

Views then refer to "polls/index.html", and templates load {% static 'polls/style.css' %}, both prefixed with the app name. Shared templates used across apps, such as , usually go in a project-level folder that you add to .

この章について質問がありますか?
前の章Getting Started with Django次の章Core Concepts
base.html
templates/
DIRS

A tour of settings.py

settings.py is an ordinary Python module. These are the settings you will touch most often:

# mysite/settings.py (excerpt)
from pathlib import Path

BASE_DIR = Path(__file__).resolve().parent.parent

SECRET_KEY = "dev-only-placeholder"
DEBUG = True
ALLOWED_HOSTS = []

DATABASES = {
    "default": {
        "ENGINE": "django.db.backends.sqlite3",
        "NAME": BASE_DIR / "db.sqlite3",
    }
}

TEMPLATES = [
    {
        "BACKEND": "django.template.backends.django.DjangoTemplates",
        "DIRS": [BASE_DIR / "templates"],
        "APP_DIRS": True,
        "OPTIONS": {
            "context_processors": [
                "django.template.context_processors.request",
                "django.contrib.auth.context_processors.auth",
                "django.contrib.messages.context_processors.messages",
            ],
        },
    },
]

LANGUAGE_CODE = "en-us"
TIME_ZONE = "UTC"
USE_TZ = True

STATIC_URL = "static/"
DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField"

BASE_DIR is the folder that contains manage.py. With USE_TZ = True, datetimes are stored in UTC and converted to TIME_ZONE for display. DEFAULT_AUTO_FIELD sets the type of the auto-incrementing primary key added to models that do not declare one.

Separating settings per environment

Never hard-code SECRET_KEY or database passwords. The simplest fix is to read them from environment variables.

# mysite/settings.py
import os

SECRET_KEY = os.environ.get("DJANGO_SECRET_KEY", "dev-only-placeholder")
DEBUG = os.environ.get("DJANGO_DEBUG", "") == "1"
ALLOWED_HOSTS = os.environ.get("DJANGO_ALLOWED_HOSTS", "localhost,127.0.0.1").split(",")

As settings grow, many teams turn settings.py into a settings/ package with base.py, dev.py and prod.py, and pick one at runtime through the DJANGO_SETTINGS_MODULE environment variable. Packages such as django-environ can also load values from a .env file.

# Run a management command with the production settings
DJANGO_SETTINGS_MODULE=mysite.settings.prod python manage.py check --deploy

Commands you run through manage.py

CommandWhat it does
runserverStart the development server
startapp nameCreate a new app
makemigrationsGenerate migration files from model changes
migrateApply migrations to the database
createsuperuserCreate an admin account
shellPython shell with your project's settings loaded
testRun the test suite
collectstaticGather static files into one folder

You can add your own commands too: create a management/commands/ folder in an app and put a class that subclasses BaseCommand in it. It then runs through manage.py like any built-in command.

Summary

  • The project folder holds manage.py and the settings package; each app holds its models, views, admin and migrations.
  • Nest templates and static files in a folder named after the app to avoid clashes.
  • Pass secrets through environment variables and split settings per environment when needed.
  • Automate routine work with manage.py commands, including custom ones.

コメント 0件

人気のコメント順新しい順

ログイン · ログインするとコメントできます。