20
13

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

[Django]プロジェクト名を変更する

Posted at

はじめに

プロジェクト名を変えたくなったので変えてみた備忘録です.
環境
python 3.6
Django 2.2

ディレクトリ構成

mysite/
  manage.py        # 変更
  mysite/
      __init__.py
      settings.py  # 変更
      urls.py
      wsgi.py      # 変更

変更する

manage.py、settings.py、wsgi.py を変更します.

manage.py

def main():
    os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'mysite.settings') # ここ
    ...

settings.py
ROOT_URLCONF = 'mysite.urls' # ここ
...

WSGI_APPLICATION = 'mysite.wsgi.application' # ここ
wsgi.py
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'mysite.settings') # ここ

あとはフォルダ名を変更したら、問題なさげでした.

おわりに

だめなときはどこかしらに旧プロジェクト名が潜んでいるので、「実行/デバッグ構成」、「環境」、「環境変数」の下を調べるといいみたいです.
参考
python - djangoでプロジェクト名を変更する

20
13
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
20
13

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?