Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Heroku deployment #4

Closed
genkiro opened this issue Oct 11, 2013 · 2 comments
Closed

Heroku deployment #4

genkiro opened this issue Oct 11, 2013 · 2 comments

Comments

@genkiro
Copy link

genkiro commented Oct 11, 2013

Hi,

Thank you for initiating this project.

I tried to download this eve-demo project, and I was able to run it fine using python run.py command. But it behaves weird when I run it using foreman start (this is from https://devcenter.heroku.com/articles/getting-started-with-python#procfile). All the possible links return a 404 Not Found error.

This problem also happens when we do deployment on Heroku. I thought it was a problem on the mongodb connection. So I made sure that the mongodb info on the settings.py is correct, but it doesn't fix the 404.

May I know how you deploy to heroku? Do you do foreman start when running locally?

@nicolaiarocci
Copy link
Member

Hello, it looks like foreman will provide a PORT variable, which tricks settings.py into thinking it is running on Heroku. You might try changing this line into: if os.environ.get('DYNO'): and see how it goes. According to Ryan Shea DYNO is available on Heroku and not on Foreman (which makes sense). Let me know if this solves your issue: I will update the demo source accordingly.

@mandarvaze
Copy link

FWIW, I ran into the same issue. I know this is an old issue (closed more than 2 yrs ago, with no confirmation from @genkiro) But I'm adding this with the hope that someone finds this useful.

I am not using foreman but I get this error on "live" heroku deployment
If I replace SERVER_NAME in my config.py with SERVER_URL the problem is fixed.

i.e. SERVER_NAME is no more defined (So I guess some default value is used, which works in heroku setup?)
I can't remember why I used SERVER_URL instead.
I am unable to remember/find the source of why this "fixes" the issue.

It worked for me twice, with the gap of 6+ months. Unfortunately I didn't document my "source" the first time. Second time (May 2016) , I just looked at my "old" git log and applied the change (somewhat reluctantly) but it worked.

May be @nicolaiarocci can add some comments on why it works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants