orf / simple

Simple is a clone of Obtvse written in Python running on Flask.
MIT License
505 stars 280 forks source link

Heroku & Database #37

Closed ghost closed 11 years ago

ghost commented 11 years ago

Not able to use PostgreSQL database in place of SQLite

hellerbarde commented 11 years ago

I don't use PostgreSQL and don't know the differences. What doesn't work? Can you help us implement it?

ghost commented 11 years ago

PostgreSQL is a heroku database addon. It suppose to be able to work through SQLAlchemy but its not. This is suppose to make it work http://goo.gl/xNv6C but I don't know how to implement it as far as coding

ghost commented 11 years ago

I tried changing "SQLALCHEMY_DATABASE_URI" to "DATABASE_URL" in the settings.py and it works but when I go to post something or edit it just gives me the error page

orf commented 11 years ago

Can you provide some form of traceback (i'm sure Heroku logs this somewhere)? While I have only run Simple on sqlite I had hoped it would run just fine on any Sqlalchemy supported database.

It seems weird that it would only error when posting or editing, because viewing the main page will result in a database read which would error if its Postgresql's fault.

ghost commented 11 years ago

Alright I'll push it to a repo later and then get the logs from heroku

ghost commented 11 years ago

actually i have figured out the issue. it is with gunicorn. i changed my procfile to "web: python simple.py" and it worked and i could post but the only issue is with gunicorn and postgresql. i pushed it to my repo http://goo.gl/VHno7 you can check it out. here are the heroku logs http://goo.gl/8z9rm

ghost commented 11 years ago

this is the error page error

orf commented 11 years ago

That shows you are not editing an issue (you are viewing /edit, you need some form of ID like so: /edit/1). How did you get to that page?

orf commented 11 years ago

I'm going to close this as there has been no activity in 13 days. Let me know if you are still experiencing this issue.