GithubHelp home page GithubHelp logo

heroku application error about pcc HOT 28 CLOSED

ehmatthes avatar ehmatthes commented on August 15, 2024
heroku application error

from pcc.

Comments (28)

ehmatthes avatar ehmatthes commented on August 15, 2024

Hi,
Can you share the url of the heroku deployment? I can see if it loads on my end, which should tell us whether your firewall is affecting anything.

You can post the build log, there might be something in there that helps. Can you share your code somehow? Either create a repository here on github, or email it to me at ehmatthes@gmail. I'll run through deployment and see if I can help you troubleshoot things. If you email the project, zip everything except the ll_env folder.

from pcc.

mbburnett88 avatar mbburnett88 commented on August 15, 2024

I'll create a repository in a bit. Thanks for your help (and quick response).

https://secret-wave-27128.herokuapp.com/

-----> Python app detected
-----> Installing python-3.6.4
-----> Installing pip
-----> Installing requirements with pip
Collecting Django==2.0.4 (from -r /tmp/build_2e2d38423b305c5db92611ab441fc9fa/requirements.txt (line 1))
Downloading https://files.pythonhosted.org/packages/89/f9/94c20658f0cdecc2b6607811e2c0bb042408a51f589e5ad0cb0eac3236a1/Django-2.0.4-py3-none-any.whl (7.1MB)
Collecting dj-database-url==0.5.0 (from -r /tmp/build_2e2d38423b305c5db92611ab441fc9fa/requirements.txt (line 2))
Downloading https://files.pythonhosted.org/packages/d4/a6/4b8578c1848690d0c307c7c0596af2077536c9ef2a04d42b00fabaa7e49d/dj_database_url-0.5.0-py2.py3-none-any.whl
Collecting dj-static==0.0.6 (from -r /tmp/build_2e2d38423b305c5db92611ab441fc9fa/requirements.txt (line 3))
Downloading https://files.pythonhosted.org/packages/2b/8f/77a4b8ec50c821193bf9682c7896f12fd0418eb3711a7d66796ede59c23b/dj-static-0.0.6.tar.gz
Collecting django-bootstrap3==9.1.0 (from -r /tmp/build_2e2d38423b305c5db92611ab441fc9fa/requirements.txt (line 4))
Downloading https://files.pythonhosted.org/packages/ca/b8/d91efa12368f28aa95cd3709c4f25f79b2c9e8735c1f87a69b45977375b1/django-bootstrap3-9.1.0.tar.gz
Collecting gunicorn==19.8.1 (from -r /tmp/build_2e2d38423b305c5db92611ab441fc9fa/requirements.txt (line 5))
Downloading https://files.pythonhosted.org/packages/55/cb/09fe80bddf30be86abfc06ccb1154f97d6c64bb87111de066a5fc9ccb937/gunicorn-19.8.1-py2.py3-none-any.whl (112kB)
Collecting pytz==2018.4 (from -r /tmp/build_2e2d38423b305c5db92611ab441fc9fa/requirements.txt (line 6))
Downloading https://files.pythonhosted.org/packages/dc/83/15f7833b70d3e067ca91467ca245bae0f6fe56ddc7451aa0dc5606b120f2/pytz-2018.4-py2.py3-none-any.whl (510kB)
Collecting static3==0.7.0 (from -r /tmp/build_2e2d38423b305c5db92611ab441fc9fa/requirements.txt (line 7))
Downloading https://files.pythonhosted.org/packages/87/b0/9cf15108b73c4f2ffffe11d237c938f57785f55d3693d822d565432cb680/static3-0.7.0.tar.gz
Collecting psycopg2>=2.6.1 (from -r /tmp/build_2e2d38423b305c5db92611ab441fc9fa/requirements.txt (line 8))
Downloading https://files.pythonhosted.org/packages/92/15/92b5c363243376ce9cb879bbec561bba196694eb663a6937b4cb967e230e/psycopg2-2.7.4-cp36-cp36m-manylinux1_x86_64.whl (2.7MB)
Installing collected packages: pytz, Django, dj-database-url, static3, dj-static, django-bootstrap3, gunicorn, psycopg2
Running setup.py install for static3: started
Running setup.py install for static3: finished with status 'done'
Running setup.py install for dj-static: started
Running setup.py install for dj-static: finished with status 'done'
Running setup.py install for django-bootstrap3: started
Running setup.py install for django-bootstrap3: finished with status 'done'
Successfully installed Django-2.0.4 dj-database-url-0.5.0 dj-static-0.0.6 django-bootstrap3-9.1.0 gunicorn-19.8.1 psycopg2-2.7.4 pytz-2018.4 static3-0.7.0
-----> $ python manage.py collectstatic --noinput
/app/.heroku/python/lib/python3.6/site-packages/psycopg2/init.py:144: UserWarning: The psycopg2 wheel package will be renamed from release 2.8; in order to keep installing from binary please use "pip install psycopg2-binary" instead. For details see: http://initd.org/psycopg/docs/install.html#binary-install-from-pypi.
""")
119 static files copied to '/tmp/build_2e2d38423b305c5db92611ab441fc9fa/staticfiles'.
-----> Discovering process types
Procfile declares types -> web
-----> Compressing...
Done: 51.2M
-----> Launching...
Released v4
https://secret-wave-27128.herokuapp.com/ deployed to Heroku

from pcc.

mbburnett88 avatar mbburnett88 commented on August 15, 2024

My requirements.txt file is below...notice the presence of "pytz" (not one of the items you specify on pp 467-68). It was in there by default, so I thought I should leave it.

fyi...running Windows 10 and executing all of the heroku commands from PowerShell.

Django==2.0.4
dj-database-url==0.5.0
dj-static==0.0.6
django-bootstrap3==9.1.0
gunicorn==19.8.1
pytz==2018.4
static3==0.7.0
psycopg2>=2.6.1

from pcc.

ehmatthes avatar ehmatthes commented on August 15, 2024

I don't see anything significant in the build log, and I see an application error as well when I visit the url. I think pytz is a dependency that django installs on its own.

Let me know when you've posted your project, and I'll try deploying it. I've deployed from Windows 10 numerous times without issue. I haven't done it through powershell, but I don't think that would make any difference.

from pcc.

mbburnett88 avatar mbburnett88 commented on August 15, 2024

OK, I found an issue in my procfile (had typed "gunicron" instead of "gunicorn"), but now I'm getting a bad request (400) error. Could you try this one and see if you can open?

Thanks!

https://arcane-shore-38441.herokuapp.com/

Below is the PS session. Notice that I don't see the phrase "Git remote heroku added" in the output produced by the "heroku create" command. The push appeared to work, so I didn't think it was problem.

Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.

PS C:\Users\mburnett> cd learning_log
PS C:\Users\mburnett\learning_log> ll_env\scripts\activate
(ll_env) PS C:\Users\mburnett\learning_log> git init
Initialized empty Git repository in C:/Users/mburnett/learning_log/.git/
(ll_env) PS C:\Users\mburnett\learning_log> git add .
warning: LF will be replaced by CRLF in learning_log/static/placeholder.txt.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in learning_logs/forms.py.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in learning_logs/templates/learning_logs/base.html.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in learning_logs/templates/learning_logs/edit_entry.html.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in learning_logs/templates/learning_logs/index.html.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in learning_logs/templates/learning_logs/new_entry.html.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in learning_logs/templates/learning_logs/new_topic.html.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in learning_logs/templates/learning_logs/topic.html.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in learning_logs/templates/learning_logs/topics.html.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in learning_logs/urls.py.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in users/templates/users/login.html.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in users/templates/users/register.html.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in users/urls.py.
The file will have its original line endings in your working directory.
(ll_env) PS C:\Users\mburnett\learning_log> git commit -am "Ready for deployment to heroku."
[master (root-commit) a0b3e13] Ready for deployment to heroku.
39 files changed, 740 insertions(+)
create mode 100644 .gitignore
create mode 100644 Procfile
create mode 100644 learning_log/init.py
create mode 100644 learning_log/settings.py
create mode 100644 learning_log/static/placeholder.txt
create mode 100644 learning_log/urls.py
create mode 100644 learning_log/wsgi.py
create mode 100644 learning_logs/init.py
create mode 100644 learning_logs/admin.py
create mode 100644 learning_logs/apps.py
create mode 100644 learning_logs/forms.py
create mode 100644 learning_logs/migrations/0001_initial.py
create mode 100644 learning_logs/migrations/0002_entry.py
create mode 100644 learning_logs/migrations/0003_topic_owner.py
create mode 100644 learning_logs/migrations/init.py
create mode 100644 learning_logs/models.py
create mode 100644 learning_logs/templates/learning_logs/base.html
create mode 100644 learning_logs/templates/learning_logs/edit_entry.html
create mode 100644 learning_logs/templates/learning_logs/index.html
create mode 100644 learning_logs/templates/learning_logs/new_entry.html
create mode 100644 learning_logs/templates/learning_logs/new_topic.html
create mode 100644 learning_logs/templates/learning_logs/topic.html
create mode 100644 learning_logs/templates/learning_logs/topics.html
create mode 100644 learning_logs/tests.py
create mode 100644 learning_logs/urls.py
create mode 100644 learning_logs/views.py
create mode 100644 manage.py
create mode 100644 requirements.txt
create mode 100644 runtime.txt
create mode 100644 users/init.py
create mode 100644 users/admin.py
create mode 100644 users/apps.py
create mode 100644 users/migrations/init.py
create mode 100644 users/models.py
create mode 100644 users/templates/users/login.html
create mode 100644 users/templates/users/register.html
create mode 100644 users/tests.py
create mode 100644 users/urls.py
create mode 100644 users/views.py
(ll_env) PS C:\Users\mburnett\learning_log> git status
On branch master
nothing to commit, working tree clean
(ll_env) PS C:\Users\mburnett\learning_log> heroku login
Enter your Heroku credentials:
Email: [email protected]
Password: **********
Logged in as [email protected]
(ll_env) PS C:\Users\mburnett\learning_log> heroku create
Creating app... done, ⬢ arcane-shore-38441
https://arcane-shore-38441.herokuapp.com/ | https://git.heroku.com/arcane-shore-38441.git
(ll_env) PS C:\Users\mburnett\learning_log> git push heroku master
Counting objects: 46, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (38/38), done.
Writing objects: 100% (46/46), 10.92 KiB | 1.21 MiB/s, done.
Total 46 (delta 2), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Python app detected
remote: -----> Installing python-3.6.4
remote: -----> Installing pip
remote: -----> Installing requirements with pip
remote: Collecting Django==2.0.4 (from -r /tmp/build_1004a8e2aebbf8be0a299eddcfd265c5/requirements.txt (line 1))
remote: Downloading https://files.pythonhosted.org/packages/89/f9/94c20658f0cdecc2b6607811e2c0bb042408a51f589e5ad0cb0eac3236a1/Django-2.0.4-py3-none-any.whl (7.1MB)
remote: Collecting dj-database-url==0.5.0 (from -r /tmp/build_1004a8e2aebbf8be0a299eddcfd265c5/requirements.txt (line 2))
remote: Downloading https://files.pythonhosted.org/packages/d4/a6/4b8578c1848690d0c307c7c0596af2077536c9ef2a04d42b00fabaa7e49d/dj_database_url-0.5.0-py2.py3-none-any.whl
remote: Collecting dj-static==0.0.6 (from -r /tmp/build_1004a8e2aebbf8be0a299eddcfd265c5/requirements.txt (line 3))
remote: Downloading https://files.pythonhosted.org/packages/2b/8f/77a4b8ec50c821193bf9682c7896f12fd0418eb3711a7d66796ede59c23b/dj-static-0.0.6.tar.gz
remote: Collecting django-bootstrap3==9.1.0 (from -r /tmp/build_1004a8e2aebbf8be0a299eddcfd265c5/requirements.txt (line 4))
remote: Downloading https://files.pythonhosted.org/packages/ca/b8/d91efa12368f28aa95cd3709c4f25f79b2c9e8735c1f87a69b45977375b1/django-bootstrap3-9.1.0.tar.gz
remote: Collecting gunicorn==19.8.1 (from -r /tmp/build_1004a8e2aebbf8be0a299eddcfd265c5/requirements.txt (line 5))
remote: Downloading https://files.pythonhosted.org/packages/55/cb/09fe80bddf30be86abfc06ccb1154f97d6c64bb87111de066a5fc9ccb937/gunicorn-19.8.1-py2.py3-none-any.whl (112kB)
remote: Collecting pytz==2018.4 (from -r /tmp/build_1004a8e2aebbf8be0a299eddcfd265c5/requirements.txt (line 6))
remote: Downloading https://files.pythonhosted.org/packages/dc/83/15f7833b70d3e067ca91467ca245bae0f6fe56ddc7451aa0dc5606b120f2/pytz-2018.4-py2.py3-none-any.whl (510kB)
remote: Collecting static3==0.7.0 (from -r /tmp/build_1004a8e2aebbf8be0a299eddcfd265c5/requirements.txt (line 7))
remote: Downloading https://files.pythonhosted.org/packages/87/b0/9cf15108b73c4f2ffffe11d237c938f57785f55d3693d822d565432cb680/static3-0.7.0.tar.gz
remote: Collecting psycopg2>=2.6.1 (from -r /tmp/build_1004a8e2aebbf8be0a299eddcfd265c5/requirements.txt (line 8))
remote: Downloading https://files.pythonhosted.org/packages/92/15/92b5c363243376ce9cb879bbec561bba196694eb663a6937b4cb967e230e/psycopg2-2.7.4-cp36-cp36m-manylinux1_x86_64.whl (2.7MB)
remote: Installing collected packages: pytz, Django, dj-database-url, static3, dj-static, django-bootstrap3, gunicorn, psycopg2
remote: Running setup.py install for static3: started
remote: Running setup.py install for static3: finished with status 'done'
remote: Running setup.py install for dj-static: started
remote: Running setup.py install for dj-static: finished with status 'done'
remote: Running setup.py install for django-bootstrap3: started
remote: Running setup.py install for django-bootstrap3: finished with status 'done'
remote: Successfully installed Django-2.0.4 dj-database-url-0.5.0 dj-static-0.0.6 django-bootstrap3-9.1.0 gunicorn-19.8.1 psycopg2-2.7.4 pytz-2018.4 static3-0.7.0
remote:
remote: -----> $ python manage.py collectstatic --noinput
remote: /app/.heroku/python/lib/python3.6/site-packages/psycopg2/init.py:144: UserWarning: The psycopg2 wheel package will be renamed from release 2.8; in order to keep installing from binary please use "pip install psycopg2-binary" instead. For details see: http://initd.org/psycopg/docs/install.html#binary-install-from-pypi.
remote: """)
remote: 119 static files copied to '/tmp/build_1004a8e2aebbf8be0a299eddcfd265c5/staticfiles'.
remote:
remote: -----> Discovering process types
remote: Procfile declares types -> web
remote:
remote: -----> Compressing...
remote: Done: 51.1M
remote: -----> Launching...
remote: Released v4
remote: https://arcane-shore-38441.herokuapp.com/ deployed to Heroku
remote:
remote: Verifying deploy... done.
To https://git.heroku.com/arcane-shore-38441.git

  • [new branch] master -> master
    (ll_env) PS C:\Users\mburnett\learning_log> heroku ps
    Free dyno hours quota remaining this month: 550h 0m (100%)
    For more information on dyno sleeping and how to upgrade, see:
    https://devcenter.heroku.com/articles/dyno-sleeping

=== web (Free): gunicorn learning_log.wsgi --log-file - (1)
web.1: starting 2018/05/01 10:03:08 -0500 (~ 11s ago)

(ll_env) PS C:\Users\mburnett\learning_log> heroku open
(ll_env) PS C:\Users\mburnett\learning_log>

from pcc.

mbburnett88 avatar mbburnett88 commented on August 15, 2024

https://github.com/mbburnett88/learning_log

I didn't upload the "ll_env" folder. If you need certain files from within that folder, please let me know.

Thanks again!

from pcc.

ehmatthes avatar ehmatthes commented on August 15, 2024

I'll try deploying at some point today. What is the output of heroku ps?

from pcc.

mbburnett88 avatar mbburnett88 commented on August 15, 2024

PS C:\Users\mburnett> cd learning_log
PS C:\Users\mburnett\learning_log> heroku ps
Free dyno hours quota remaining this month: 550h 0m (100%)
For more information on dyno sleeping and how to upgrade, see:
https://devcenter.heroku.com/articles/dyno-sleeping

=== web (Free): gunicorn learning_log.wsgi --log-file - (1)
web.1: up 2018/05/01 10:54:39 -0500 (~ 12m ago)

PS C:\Users\mburnett\learning_log>

from pcc.

mbburnett88 avatar mbburnett88 commented on August 15, 2024

I noticed that your example on pp 473 lacks the '(1)' at the end.

from pcc.

ehmatthes avatar ehmatthes commented on August 15, 2024

Ha! I think I caught you copying and pasting. :)

Look at this line in the heroku part of settings.py, in your project:

    ALLOWED_HOSTS = ['learning-log-final.herokuapp.com']

That came from the version of settings.py that I uploaded for the book. This helps prevent attacks where people are faking the host, although I don't fully understand that attack. It's nice to use a current, updated framework like django and know that most or all of the common attacks are mitigated agains.

You are not serving the project from http://learning-log-final.herokuapp.com/, so django is returning a bad request error.

If you look at the heroku settings on page 469, you'll see

ALLOWED_HOSTS = ['*']

This tells django to serve from any host. It's not entirely secure, but that's addressed towards the end of the chapter.

So, how to fix this:

  • Change the ALLOWED_HOSTS setting in your local project.
  • > git commit -am "Fixed ALLOWED_HOSTS setting."
  • > git push heroku master

I believe your project will work at that point.

Please let me know how it goes!

from pcc.

ehmatthes avatar ehmatthes commented on August 15, 2024

You should also take a look at the Ignoring Files section on page 472. Your local database has been pushed to heroku, along with your virtual environment as well, although that might be filtered out by heroku.

Feel free to ask questions about any of this, not just the specific issue that started this thread. I always learn something by helping people troubleshoot, so ask away.

from pcc.

mbburnett88 avatar mbburnett88 commented on August 15, 2024

Success, thank you!

https://salty-crag-39772.herokuapp.com/

And yes, I'm guilty of copy/pasting...but only the Heroku settings. Everything else I typed in character by character, tapping the space bar four times for every indentation ;-).

from pcc.

mbburnett88 avatar mbburnett88 commented on August 15, 2024

https://higher-learning-log.herokuapp.com/admin/

from pcc.

ehmatthes avatar ehmatthes commented on August 15, 2024

That's great! Let me know if you run into anything else.

from pcc.

mbburnett88 avatar mbburnett88 commented on August 15, 2024

Hi Eric,

I would guess that your book is the only Python book on the planet that has profanity in it! I lol'd when I saw that in the chart on page 386.

Thanks again for all of your help pushing through that wall on project 3. I really appreciate it!

from pcc.

dev-assassin avatar dev-assassin commented on August 15, 2024

I don't see anything significant in the build log, and I see an application error as well when I visit the url. I think pytz is a dependency that django installs on its own.

Let me know when you've posted your project, and I'll try deploying it. I've deployed from Windows 10 numerous times without issue. I haven't done it through powershell, but I don't think that would make any difference.

Also I have same problem.
Even though the build was successes, but I couldn't see the deployed app.

-----> Node.js app detected
       
-----> Creating runtime environment
       
       NPM_CONFIG_LOGLEVEL=error
       NODE_ENV=production
       NODE_MODULES_CACHE=true
       NODE_VERBOSE=false
       
-----> Installing binaries
       engines.node (package.json):  unspecified
       engines.npm (package.json):   unspecified (use default)
       
       Resolving node version 12.x...
       Downloading and installing node 12.18.1...
       Using default npm version: 6.14.5
       
-----> Installing dependencies
       Installing node modules
       
       > [email protected] postinstall /tmp/build_5a07f7a56a71afa8243c7f5ed2a69c1b/node_modules/babel-runtime/node_modules/core-js
       > node -e "try{require('./postinstall')}catch(e){}"
       
       
       > [email protected] install /tmp/build_5a07f7a56a71afa8243c7f5ed2a69c1b/node_modules/webpack-dev-server/node_modules/fsevents
       > node install.js
       
       
       Skipping 'fsevents' build as platform linux is not supported
       
       > [email protected] install /tmp/build_5a07f7a56a71afa8243c7f5ed2a69c1b/node_modules/watchpack-chokidar2/node_modules/fsevents
       > node install.js
       
       
       Skipping 'fsevents' build as platform linux is not supported
       
       > [email protected] postinstall /tmp/build_5a07f7a56a71afa8243c7f5ed2a69c1b/node_modules/core-js
       > node -e "try{require('./postinstall')}catch(e){}"
       
       
       > [email protected] install /tmp/build_5a07f7a56a71afa8243c7f5ed2a69c1b/node_modules/jest-haste-map/node_modules/fsevents
       > node install.js
       
       
       Skipping 'fsevents' build as platform linux is not supported
       
       > [email protected] postinstall /tmp/build_5a07f7a56a71afa8243c7f5ed2a69c1b/node_modules/core-js-pure
       > node -e "try{require('./postinstall')}catch(e){}"
       
       
       > [email protected] postinstall /tmp/build_5a07f7a56a71afa8243c7f5ed2a69c1b/node_modules/jss
       > node -e "console.log('\u001b[35m\u001b[1mLove JSS? You can now support us on open collective:\u001b[22m\u001b[39m\n > \u001b[34mhttps://opencollective.com/jss/donate\u001b[0m')"
       
       Love JSS? You can now support us on open collective:
        > https://opencollective.com/jss/donate
       added 1821 packages in 33.082s
       
-----> Build
       Running build
       
       > [email protected] build /tmp/build_5a07f7a56a71afa8243c7f5ed2a69c1b
       > react-scripts build
       
       Creating an optimized production build...
       Compiled with warnings.
       
       ./src/components/roles/superadmin/superadmin_category.component.js
         Line 174:25:  The href attribute requires a valid value to be accessible. Provide a valid, navigable address as the href value. If you cannot provide a valid href, but still need the element to resemble a link, use a button and change it with appropriate styles. Learn more: https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/anchor-is-valid.md         jsx-a11y/anchor-is-valid
       
       Search for the keywords to learn more about each warning.
       To ignore, add // eslint-disable-next-line to the line before.
       
       File sizes after gzip:
       
         166.08 KB  build/static/js/2.7ecd3a93.chunk.js
         23.28 KB   build/static/css/2.ddfb3f3a.chunk.css
         9.13 KB    build/static/js/main.94785534.chunk.js
         1.57 KB    build/static/css/main.f749b95d.chunk.css
         770 B      build/static/js/runtime-main.e2583afb.js
       
       The project was built assuming it is hosted at /.
       You can control this with the homepage field in your package.json.
       
       The build folder is ready to be deployed.
       You may serve it with a static server:
       
         npm install -g serve
         serve -s build
       
       Find out more about deployment here:
       
         bit.ly/CRA-deploy
       
       
-----> Caching build
       - node_modules
       
-----> Pruning devDependencies
       audited 1825 packages in 13.317s
       
       64 packages are looking for funding
         run `npm fund` for details
       
       found 1 low severity vulnerability
         run `npm audit fix` to fix them, or `npm audit` for details
       
-----> Build succeeded!
-----> Discovering process types
       Procfile declares types     -> (none)
       Default types for buildpack -> web
-----> Compressing...
       Done: 186.3M
-----> Launching...
       Released v3
       https://ship-management.herokuapp.com/ deployed to Heroku

from pcc.

ehmatthes avatar ehmatthes commented on August 15, 2024

Are you trying to push the Learning Log project to heroku?

-----> Node.js app detected

Your project is not being detected as a Python project; Heroku thinks you are trying to deploy a Node project. Did you make a requirements.txt file?

from pcc.

dev-assassin avatar dev-assassin commented on August 15, 2024

@ehmatthes
My project is not Python, it's React project using Node.
Where do I have to make requirements.txt file?

from pcc.

ehmatthes avatar ehmatthes commented on August 15, 2024

This is a closed issue on a repository for a book about Python. Why are you asking me about deploying a Node project here?

from pcc.

suhail767 avatar suhail767 commented on August 15, 2024

I don't know whether the repository is still alive. I'm having the same problem. Updated my project with the updates provided herehttps://ehmatthes.github.io/pcc/chapter_20/README.html.

`(ll_env) D:\Important Documents\Programming\Python\Atom\Python Crash Course\Projects\learning_log>git push heroku main
Enumerating objects: 66, done.
Counting objects: 100% (66/66), done.
Delta compression using up to 12 threads
Compressing objects: 100% (58/58), done.
Writing objects: 100% (66/66), 12.28 KiB | 546.00 KiB/s, done.
Total 66 (delta 20), reused 0 (delta 0), pack-reused 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.9.1
remote: Learn More: https://devcenter.heroku.com/articles/python-runtimes
remote: -----> Installing python-3.9.0
remote: -----> Installing pip 20.1.1, setuptools 47.1.1 and wheel 0.34.2
remote: -----> Installing SQLite3
remote: -----> Installing requirements with pip
remote: Collecting asgiref==3.3.1
remote: Downloading asgiref-3.3.1-py3-none-any.whl (19 kB)
remote: Collecting dj-database-url==0.5.0
remote: Downloading dj_database_url-0.5.0-py2.py3-none-any.whl (5.5 kB)
remote: Collecting Django==3.1.4
remote: Downloading Django-3.1.4-py3-none-any.whl (7.8 MB)
remote: Collecting django-bootstrap3==14.2.0
remote: Downloading django_bootstrap3-14.2.0-py3-none-any.whl (23 kB)
remote: Collecting gunicorn==20.0.4
remote: Downloading gunicorn-20.0.4-py2.py3-none-any.whl (77 kB)
remote: Collecting pytz==2020.4
remote: Downloading pytz-2020.4-py2.py3-none-any.whl (509 kB)
remote: Collecting sqlparse==0.4.1
remote: Downloading sqlparse-0.4.1-py3-none-any.whl (42 kB)
remote: Collecting whitenoise==5.2.0
remote: Downloading whitenoise-5.2.0-py2.py3-none-any.whl (19 kB)
remote: Collecting psycopg2==2.8.6
remote: Downloading psycopg2-2.8.6.tar.gz (383 kB)
remote: Collecting django-heroku==0.3.1
remote: Downloading django_heroku-0.3.1-py2.py3-none-any.whl (6.2 kB)
remote: Building wheels for collected packages: psycopg2
remote: Building wheel for psycopg2 (setup.py): started
remote: Building wheel for psycopg2 (setup.py): finished with status 'done'
remote: Created wheel for psycopg2: filename=psycopg2-2.8.6-cp39-cp39-linux_x86_64.whl size=481751 sha256=7299ad7b8aad7aa25eed2f030a0faa972c9f3a8dc60b239a2170305f85ac2ad4
remote: Stored in directory: /tmp/pip-ephem-wheel-cache-_qxexcm5/wheels/a2/07/10/a9a82e72d50feb8d646acde6a88000bbf2ca0f82e41aea438a
remote: Successfully built psycopg2
remote: Installing collected packages: asgiref, dj-database-url, pytz, sqlparse, Django, django-bootstrap3, gunicorn, whitenoise, psycopg2, django-heroku
remote: Successfully installed Django-3.1.4 asgiref-3.3.1 dj-database-url-0.5.0 django-bootstrap3-14.2.0 django-heroku-0.3.1 gunicorn-20.0.4 psycopg2-2.8.6 pytz-2020.4 sqlparse-0.4.1 whitenoise-5.2.0
remote: -----> $ python manage.py collectstatic --noinput
remote: 133 static files copied to '/tmp/build_ea2844dc/learning_log/staticfiles', 421 post-processed.
remote:
remote: -----> Discovering process types
remote: Procfile declares types -> web
remote:
remote: -----> Compressing...
remote: Done: 57.8M
remote: -----> Launching...
remote: Released v5
remote: https://stark-tundra-12296.herokuapp.com/ deployed to Heroku
remote:
remote: Verifying deploy... done.
To https://git.heroku.com/stark-tundra-12296.git

  • [new branch] main -> main`

from pcc.

suhail767 avatar suhail767 commented on August 15, 2024

Application error
An error occurred in the application and your page could not be served. If you are the application owner, check your logs for details. You can do this from the Heroku CLI with the command

Getting this error while trying to open the URL.

And also heroku ps command gives me this.

(ll_env) D:\Important Documents\Programming\Python\Atom\Python Crash Course\Projects\learning_log>heroku ps
Free dyno hours quota remaining this month: 550h 0m (100%)
Free dyno usage for this app: 0h 0m (0%)
For more information on dyno sleeping and how to upgrade, see:
https://devcenter.heroku.com/articles/dyno-sleeping

=== web (Free): gunicorn learning_log.wsgi --log-file - (1)
web.1: crashed 2020/12/25 22:56:15 +0530 (~ 3m ago)

from pcc.

suhail767 avatar suhail767 commented on August 15, 2024

And I tried to run the website using python mange.py runserver. I don't know that I should be doing that, but I am not getting any error and the website is opening fine.

from pcc.

ehmatthes avatar ehmatthes commented on August 15, 2024

This repository is for the first edition of Python Crash Course. The second edition has been out now for over a year and a half. I no longer troubleshoot this project from the first edition; too much has changed since the various printings of the first edition came out with to keep up with. If you pick up a copy of the second edition it is up to date, and you will likely be more successful with this project.

from pcc.

suhail767 avatar suhail767 commented on August 15, 2024

Okay, I'll get a copy then. Thank you

from pcc.

suhail767 avatar suhail767 commented on August 15, 2024

People who are having the same issue may find this helpful.
I have managed to solve the problem by referring to the source code https://github.com/ehmatthes/pcc . I have also updated to bootstrap4 and made changes to requirements.txt and settings.py. And don't forget to load bootstrap4 in the respective templates.

from pcc.

Single-Dev avatar Single-Dev commented on August 15, 2024

I successfully deploy to heroku, but Application error. codes here https://github.com/bekzodbek2006/furn-master

P.S.: Django App

from pcc.

ehmatthes avatar ehmatthes commented on August 15, 2024

@Bekzodbek2006 you are posting on a 4.5 year old closed issue, about an entirely different project. I'm not sure why you posted here.

from pcc.

ehmatthes avatar ehmatthes commented on August 15, 2024

I am locking this issue. For any Python Crash Course readers who come here, please note that the first edition of the book is quite out of date at this point. If you have questions about the 2nd edition of the book, that repository is here. For the 3rd edition, look here.

from pcc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.