Error on Deployment Django App with Heroku - django

I know there is already a Topic of Desployment on Heroku with Django but it didn´t help me.
I have following error:
! Error while running '$ python markb/manage.py collectstatic --noinput'.
See traceback above for details.
You may need to update application code to resolve this error.
Or, you can disable collectstatic for this application:
$ heroku config:set DISABLE_COLLECTSTATIC=1
https://devcenter.heroku.com/articles/django-assets
! Push rejected, failed to compile Python app.
! Push failed

Disable collectstatic using below command:
set DISABLE_COLLECTSTATIC=1
And then try.

Related

Heroku Application Error while Deploying Django application

enter image description here
Please help me with this error
It may be due to your static files.
Try the following:
heroku config:set DISABLE_COLLECTSTATIC=1
git push heroku main
heroku run python manage.py migrate
heroku run 'bower install --config.interactive=false;grunt
prep;python
manage.py collectstatic --noinput'
heroku config:unset DISABLE_COLLECTSTATIC
heroku run python manage.py collectstatic
Hope this helps.
I can also see the console says: could not find module 'whitenoise'. Have you set your requirements.txt properly?

Can't deploy Django on Heroku due to static error [duplicate]

This question already has answers here:
Heroku missing required flag: -a,
(11 answers)
Closed 1 year ago.
Hello I am trying to launch my django website on heroku. I downloaded the heroku CLI, and I am running the following code on fish to resolve the error:
heroku config:set DISABLE_COLLECTSTATIC=1
however I am getting the following error
› Error: Missing required flag:
› -a, --app APP app to run command against
› See more help with --help
Can someone please tell me how to resolve this issue?
The error is very clearly indicating you need to add -a or --app flag
Try running,
heroku config:set DISABLE_COLLECTSTATIC=1 -a YOUR_APP_NAME_HERE

Push rejected by Heroku for the static file collection reason

When I'm trying to deploy a Django app to Heroku, encounter the identical problem as python - Collectstatic error while deploying Django app to Heroku - Stack Overflow
it starts to build, download and installs everything, but that's what I get when it comes to collecting static files:
$ git push heroku master
Counting objects: 5375, done.
Total 5375 (delta 1092), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Python app detected
remote: -----> Installing requirements with pip
remote:
...
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: Verifying deploy....
remote:
remote: ! Push rejected to fierce-cove-94300.
remote:
To https://git.heroku.com/fierce-cove-94300.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/fierce-cove-94300.git'
I tried all its answers, but not helps.
Additional I tried Django and Static Assets | Heroku Dev Center to configure the setting and install whitenoise and commit changes.
The problem is not solved.
Disable auto collectstatic:
heroku config:set DISABLE_COLLECTSTATIC=1
Then push your project to heroku. After the deploy is done, manually collectstatic as below:
heroku run python manage.py collectstatic
If you still get errors, your static files config is probably the reason. Try making it simple, remove whitenoise and use a s3 bucket for example.

Heroku error "! Authentication failure"

I have deployed a django app on heroku and it is working fine. But I want to run the command "python manage.py makemigrations" but it is giving me authentication error.
I am using command: "heroku run python manage.py makemigrations"
I have used my credentials correctly as I am able to use "git push heroku master".
Terminal output:
$ heroku run python manage.py makemigrations
Running `python manage.py makemigrations` attached to terminal... up, run.3514
! Authentication error

Change path to manage.py when running Git Push Heroku Master

I just deployed Askbot forum to heroku successfully, but sometimes when running 'git push heroku master', the automatic collectstatic process fails (to me it looks like a random failure), prompting:
-----> Python app detected
-----> Installing dependencies with pip
Cleaning up...
-----> Preparing static assets
Collectstatic configuration error. To debug, run:
$ heroku run python ./askbot/setup_templates/manage.py collectstatic --noinput`
Well I don't really know if that's the problem, but the manage.py in .askbot/setup_templates/ contains the app's native version of the file, not the one I'm using for deployment, which is located in the app's root.
How could I make git push heroku master use the right manage.py file?
Change the path in your Procfile. Typically its something like this:
web: gunicorn hellodjango.wsgi --log-file -
Adjust it:
# from:
web: gunicorn .askbot/setup_templates/yourApp.wsgi
# to:
web: gunicorn .askbot/yourApp.wsgi
to check if the path was indeed your problem run this from the terminal:
heroku run python ./manage.py collectstatic
# or
heroku run python ./yourApp.wsgi collectstatic
Deleting or renaming Manage.py in askbot/setup_templates/ solved the problem.
Git Push Heroku Master never fails whan running collectstatic ever after.
so I believe that for some reason, probably because of sys.path configuration sometimes
Git Push Heroku Master first discovered and used ./askbot/setup_templates/manage.py instead of ./manage.py (which was the right one), and encountered an ImportError.