Django + Heroku +すべての必要な依存関係を使用してアプリケーションを作成しようとしています。私はthese instructionsとthisImportError:import dj_database_url ImportError: 'dj_database_url'というモジュールがありません
でそれを修正しようとしてい
import dj_database_url ImportError: No module named 'dj_database_url'
:私はpython3 manage.py runserver
を実行したときに、このエラーを取得しておくしかし
migrating an existing django project
:これらの手順を実行した後
これは私のコードです:
私は、これは私はまだ午前私requirements.txtファイルに
dj-database-url==0.4.2
gunicorn==19.7.1
whitenoise==3.3.0
ある従っSTATIC資産necessitities
PROJECT_ROOT = os.path.dirname(os.path.abspath(__file__))
STATIC_ROOT = os.path.join(PROJECT_ROOT, 'staticfiles')
STATIC_URL = '/static/'
# Extra places for collectstatic to find static files.
STATICFILES_DIRS = (
os.path.join(PROJECT_ROOT, 'static'),
)
STATICFILES_STORAGE = 'whitenoise.django.GzipManifestStaticFilesStorage'
を追加しましたDJ-データベースURLに
import dj_database_url
db_from_env = dj_database_url.config(conn_max_age=500)
DATABASES['default'].update(db_from_env)
をインポートImportError
を取得しています。これをどうやって解決するのですか?
は、ローカルサーバーまたはHeroku上のこのエラーですか? –
@SachinKukrejaわかりません。私はピップfreeze' 'の –
出力は' DJ-を含むローカルと思い '/Users/iivri.andre/virtualenvironment/new_app/Tut/Tut/settings.py、ライン14、' :エラーパスはこれですdatabase-url'?それを仮想環境にインストールしましたか?ガンコニックを再起動しましたか? django開発サーバーで試した? [移行既存のDjangoプロジェクト](https://devcenter.heroku.com/articles/django-app-configuration#migrating-an-existing-django-project) 私は走った:私はこれらの手順に従っ –