簡體   English   中英

我的 django 項目不想部署到 heroku

[英]My django project doesn't want to be deployed on heroku

我想在 heroku 上推送我的 django 項目,我完成了教程中的所有步驟,但出現錯誤ModuleNotFoundError: there is no module called 'ckeditor'我試圖通過執行此 stackoverflow 帖子中的所有步驟來解決此問題 - ModuleNotFoundError:django 中沒有名為“ckeditor_uploader”的模塊,但這對我不起作用。 這是我的settings.py -> https://codeshare.io/Jb786X

這是我的回溯

(venvecosite) (base) cristian@FInch:~/Desktop/GreatEcology my project/ecosite/ecowebsite$ git push heroku master
Enumerating objects: 1716, done.
Counting objects: 100% (1716/1716), done.
Delta compression using up to 4 threads
Compressing objects: 100% (1685/1685), done.
Writing objects: 100% (1716/1716), 46.84 MiB | 6.84 MiB/s, done.
Total 1716 (delta 174), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote: 
remote: -----> Building on the Heroku-20 stack
remote: -----> Determining which buildpack to use for this app
remote: -----> Python app detected
remote: -----> Using Python version specified in runtime.txt
remote:  !     Python has released a security update! Please consider upgrading to python-3.8.11
remote:        Learn More: https://devcenter.heroku.com/articles/python-runtimes
remote: -----> Installing python-3.8.5
remote: -----> Installing pip 20.2.4, setuptools 47.1.1 and wheel 0.36.2
remote: -----> Installing dependencies with Pipenv 2020.11.15
remote:        Installing dependencies from Pipfile.lock (180c80)...
remote: -----> Installing SQLite3
remote: -----> $ python manage.py collectstatic --noinput
remote:        Traceback (most recent call last):
remote:          File "manage.py", line 22, in <module>
remote:            main()
remote:          File "manage.py", line 18, in main
remote:            execute_from_command_line(sys.argv)
remote:          File "/app/.heroku/python/lib/python3.8/site-packages/django/core/management/__init__.py", line 419, in execute_from_command_line
remote:            utility.execute()
remote:          File "/app/.heroku/python/lib/python3.8/site-packages/django/core/management/__init__.py", line 395, in execute
remote:            django.setup()
remote:          File "/app/.heroku/python/lib/python3.8/site-packages/django/__init__.py", line 24, in setup
remote:            apps.populate(settings.INSTALLED_APPS)
remote:          File "/app/.heroku/python/lib/python3.8/site-packages/django/apps/registry.py", line 91, in populate
remote:            app_config = AppConfig.create(entry)
remote:          File "/app/.heroku/python/lib/python3.8/site-packages/django/apps/config.py", line 224, in create
remote:            import_module(entry)
remote:          File "/app/.heroku/python/lib/python3.8/importlib/__init__.py", line 127, in import_module
remote:            return _bootstrap._gcd_import(name[level:], package, level)
remote:          File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
remote:          File "<frozen importlib._bootstrap>", line 991, in _find_and_load
remote:          File "<frozen importlib._bootstrap>", line 973, in _find_and_load_unlocked
remote:        ModuleNotFoundError: No module named 'ckeditor'
remote: 
remote:  !     Error while running '$ python manage.py collectstatic --noinput'.
remote:        See traceback above for details.
remote: 
remote:        You may need to update application code to resolve this error.
remote:        Or, you can disable collectstatic for this application:
remote: 
remote:           $ heroku config:set DISABLE_COLLECTSTATIC=1
remote: 
remote:        https://devcenter.heroku.com/articles/django-assets
remote:  !     Push rejected, failed to compile Python app.
remote: 
remote:  !     Push failed
remote:  !
remote:  ! ## Warning - The same version of this code has already been built: e1f2829e026243df3b14edd336ce0a60207c67b6
remote:  !
remote:  ! We have detected that you have triggered a build from source code with version e1f2829e026243df3b14edd336ce0a60207c67b6
remote:  ! at least twice. One common cause of this behavior is attempting to deploy code from a different branch.
remote:  !
remote:  ! If you are developing on a branch and deploying via git you must run:
remote:  !
remote:  !     git push heroku <branchname>:main
remote:  !
remote:  ! This article goes into details on the behavior:
remote:  !   https://devcenter.heroku.com/articles/duplicate-build-version
remote: 
remote: Verifying deploy...
remote: 
remote: !       Push rejected to ecowebsite3.
remote: 
To https://git.heroku.com/ecowebsite3.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/ecowebsite3.git'

感謝 jastr,我的應用程序已成功部署到 Heroku!

問題是我的PipenvPipfile.lock文件已經過時(它們不包括 django-ckeditor)。 我按照這篇文章從本地刪除了我的 pipenv 和 pipfile.lock 文件,並將這些更改推送到 github。刪除這些文件后,Heroku 被迫安裝requirements.txt文件中列出的包。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM