Andreu C.
Andreu C.

Reputation: 177

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?

Upvotes: 0

Views: 422

Answers (2)

Andreu C.
Andreu C.

Reputation: 177

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.

Upvotes: 0

agconti
agconti

Reputation: 18123

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

Upvotes: 0

Related Questions