Djangoroidの奮闘記

python,django,angularJS1~三十路過ぎたプログラマーの奮闘記

django "ecommerce-2" 3 Requirements~ 4 Setup Previous Project

今回の動画

Coding for Entrepreneurs Coding for Entrepreneurs

Setup Previous Project

  • githubより前回のtrydjango1.8をcloneしてくる

  • あと、'sudo pip install requests[security]' でsecurity関連のライブラリをinstallしておく

*django ==1.8.4 にupgradeしておく

  • 必ず、pip installのあとは、pip freeze > requirements.txt で書き込んでおく

  • 不要なdb.sqlite,db2.sqlite を削除

  • データベースを削除したので、python manage.py migrate する

  • python manage.py createsuperuser すると、model関連のerrorが出る。

  • django-registration-redux がちょっと古いversionなのが原因ようなので、upgradeする。

  • pip freeze > requirements.txt

  • python manage.py createsuperuser でsuperuserを作成する

  • python manage.py makemigration → migrateすると、以下のerrorが出るので、これを削除すればいいような気がする。

django.db.utils.OperationalError: table "registration_registrationprofile" already exists

なので、db.sqlite3を削除して、migrate → 再度createsuperuser で解決 (たぶん、registration-reduxをupgradeする前に作ってた、db.sqlite3のデータベースと整合性が取れなかったと思う)

  • python manage.py runserver でちゃんとサイトが表示されるのを見て終了。