Django project deploy on Heroku with errors

Asked

Viewed 162 times

1

When trying to deploy my Python project using Django on Heroku, I am getting the following error.

Counting objects: 3, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 273 bytes | 273.00 KiB/s, done.
Total 3 (delta 1), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote: 
remote: -----> Python app detected
remote:  !     Python has released a security update! Please consider upgrading to python-3.6.7
remote:        Learn More: https://devcenter.heroku.com/articles/python-runtimes
remote: -----> Found python-3.7.0, removing
remote: -----> Installing python-3.6.4
remote: -----> Installing pip
remote: -----> Installing dependencies with Pipenv 2018.5.18…
remote:        Installing dependencies from Pipfile…
remote:        An error occurred while installing django-render-block==0.5! Will try again.
remote:        An error occurred while installing pipenv==9.0.3! Will try again.
remote:        Installing initially–failed dependencies…
remote:        Success installing django-render-block==0.5!
remote:        Success installing pipenv==9.0.3!
remote: -----> Discovering process types
remote:        Procfile declares types -> release, web
remote: 
remote: -----> Compressing...
remote:        Done: 336.9M
remote: -----> Launching...
remote:  !     Warning: Your slug size exceeds our soft limit (336 MB) which may affect boot time.
remote:        Released v10
remote:        https://erpgetcode.herokuapp.com/ deployed to Heroku
remote: 
remote: Verifying deploy... done.
remote: Running release command...
remote: 
remote: Traceback (most recent call last):
remote:   File "manage.py", line 23, in <module>
remote:     execute_from_command_line(sys.argv)
remote:   File "/app/.heroku/python/lib/python3.6/site-packages/django/core/management/__init__.py", line 381, in execute_from_command_line
remote:     utility.execute()
remote:   File "/app/.heroku/python/lib/python3.6/site-packages/django/core/management/__init__.py", line 375, in execute
remote:     self.fetch_command(subcommand).run_from_argv(self.argv)
remote:   File "/app/.heroku/python/lib/python3.6/site-packages/django/core/management/__init__.py", line 224, in fetch_command
remote:     klass = load_command_class(app_name, subcommand)
remote:   File "/app/.heroku/python/lib/python3.6/site-packages/django/core/management/__init__.py", line 36, in load_command_class
remote:     module = import_module('%s.management.commands.%s' % (app_name, name))
remote:   File "/app/.heroku/python/lib/python3.6/importlib/__init__.py", line 126, in import_module
remote:     return _bootstrap._gcd_import(name[level:], package, level)
remote:   File "<frozen importlib._bootstrap>", line 994, in _gcd_import
remote:   File "<frozen importlib._bootstrap>", line 971, in _find_and_load
remote:   File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
remote:   File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
remote:   File "<frozen importlib._bootstrap_external>", line 678, in exec_module
remote:   File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
remote:   File "/app/.heroku/python/lib/python3.6/site-packages/django/core/management/commands/migrate.py", line 14, in <module>
remote:     from django.db.migrations.autodetector import MigrationAutodetector
remote:   File "/app/.heroku/python/lib/python3.6/site-packages/django/db/migrations/autodetector.py", line 11, in <module>
remote:     from django.db.migrations.questioner import MigrationQuestioner
remote:   File "/app/.heroku/python/lib/python3.6/site-packages/django/db/migrations/questioner.py", line 9, in <module>
remote:     from .loader import MigrationLoader
remote:   File "/app/.heroku/python/lib/python3.6/site-packages/django/db/migrations/loader.py", line 8, in <module>
remote:     from django.db.migrations.recorder import MigrationRecorder
remote:   File "/app/.heroku/python/lib/python3.6/site-packages/django/db/migrations/recorder.py", line 9, in <module>
remote:     class MigrationRecorder:
remote:   File "/app/.heroku/python/lib/python3.6/site-packages/django/db/migrations/recorder.py", line 22, in MigrationRecorder
remote:     class Migration(models.Model):
remote:   File "/app/.heroku/python/lib/python3.6/site-packages/django/db/models/base.py", line 87, in __new__
remote:     app_config = apps.get_containing_app_config(module)
remote:   File "/app/.heroku/python/lib/python3.6/site-packages/django/apps/registry.py", line 249, in get_containing_app_config
remote:     self.check_apps_ready()
remote:   File "/app/.heroku/python/lib/python3.6/site-packages/django/apps/registry.py", line 131, in check_apps_ready
remote:     settings.INSTALLED_APPS
remote:   File "/app/.heroku/python/lib/python3.6/site-packages/django/conf/__init__.py", line 57, in __getattr__
remote:     self._setup(name)
remote:   File "/app/.heroku/python/lib/python3.6/site-packages/django/conf/__init__.py", line 44, in _setup
remote:     self._wrapped = Settings(settings_module)
remote:   File "/app/.heroku/python/lib/python3.6/site-packages/django/conf/__init__.py", line 107, in __init__
remote:     mod = importlib.import_module(self.SETTINGS_MODULE)
remote:   File "/app/.heroku/python/lib/python3.6/importlib/__init__.py", line 126, in import_module
remote:     return _bootstrap._gcd_import(name[level:], package, level)
remote:   File "/app/djangosige/configs/__init__.py", line 3, in <module>
remote:     from .settings import *
remote:   File "/app/djangosige/configs/settings.py", line 2, in <module>
remote:     from decouple import config, Csv
remote: ModuleNotFoundError: No module named 'decouple'
remote: Waiting for release.... failed.
To https://git.heroku.com/erpgetcode.git
   47ea108..cd777ac  master -> master

my Requirements.txt

django==2.0.5
dj-database-url==0.5.*
python-decouple==3.1
pytz==2018.3
reportlab==3.4.*
six==1.11.*
cryptography>=2.3
lxml==4.2.*
pyOpenSSL==17.5.*
signxml==2.5.*

Procfile

release: python3 manage.py migrate
web: gunicorn erpgetcode.wsgi
web: gunicorn erpgetcode:app

Runtime.txt

 python-3.6.4

Pipfile

[[source]]

url = "https://pypi.python.org/simple"
verify_ssl = true
name = "pypi"


[packages]

astroid = "==1.5.3"
certifi = "==2018.1.18"
chardet = "==3.0.4"
colorama = "==0.3.9"
django = "*"
django-render-block = "==0.5"
django-templated-email = "*"
"flake8" = "==3.5.0"
idna = "==2.6"
isort = "==4.2.15"
lazy-object-proxy = "==1.3.1"
mccabe = "==0.6.1"
pew = "==1.1.2"
pipenv = "==9.0.3"
psutil = "==5.3.1"
pycodestyle = "==2.3.1"
pyflakes = "==1.6.0"
pylint = "==1.7.4"
pytz = "==2017.3"
requests = "==2.18.4"
"urllib3" = "==1.22"
virtualenv = "==15.1.0"
virtualenv-clone = "==0.2.6"
wrapt = "==1.10.11"


[dev-packages]



[requires]

python_version = "*"

I tried that

$ pip3 install python-decouple

But you said it’s already installed

Requirement already satisfied: python-decouple in /home/rafael/.local/lib/python3.6/site-packages (3.1)

I also tried to change the Python version to 3.6.7, but the same happened.

Does anyone have any idea what’s wrong?

  • 1

    Python-decouple is not listed in your pipfile, try uninstalling it and installing again but using pipenv install. When you install the dependency directly by Pip, it is not saved in pipfile.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.