degeist / book-cover-generator

A tool to create user-generated book covers and share on social media.
Other
2 stars 0 forks source link

Artboard view onclick #46

Closed erasmus closed 8 years ago

erasmus commented 8 years ago

Fix #30 Fix #41

erasmus commented 8 years ago

@avorio I tried to take this online. Get 500 Error on the artboard view.

e.g. https://danandphil-pr-46.herokuapp.com/artboard/v1469544127/mxm3edyfuwednbsmmldx.jpg/?cutout=dp-cutout4.png&text=derp

Could you please have a look?

avorio commented 8 years ago

You should turn Debug = True to go beyond the Error 500. I'm doing that now.

avorio commented 8 years ago

Here's the error:

screen shot 2016-07-26 at 14 26 02

It looks like the database has not been populated. I'm guessing it's because Heroku is not copying the database upon deployment of review branches. I'll investigate now.

avorio commented 8 years ago

YES, my assumption was correct. The database for the review branch was empty.

Here's how I solved it (via Heroku CLI):

# 'python manage.py migrate' is the Django command to build the database
# Below is how you run that command directly in a Heroku instance
heroku run python manage.py migrate --app danandphil-pr-46

Here's the output:

Operations to perform:
  Apply all migrations: contenttypes, auth, admin, artboard, sessions
Running migrations:
  Rendering model states... DONE
  Applying contenttypes.0001_initial... OK
  Applying auth.0001_initial... OK
  Applying admin.0001_initial... OK
  Applying admin.0002_logentry_remove_auto_add... OK
  Applying artboard.0001_initial... OK
  Applying contenttypes.0002_remove_content_type_name... OK
  Applying auth.0002_alter_permission_name_max_length... OK
  Applying auth.0003_alter_user_email_max_length... OK
  Applying auth.0004_alter_user_username_opts... OK
  Applying auth.0005_alter_user_last_login_null... OK
  Applying auth.0006_require_contenttypes_0002... OK
  Applying auth.0007_alter_validators_add_error_messages... OK
  Applying sessions.0001_initial... OK

Now that URL is generating an error 404, which is expected as the database [structure] has been built but there are no artboards in it. See the troubleshooting image below.

screen shot 2016-07-26 at 14 28 46

avorio commented 8 years ago

Yay! Your review branch seems to be working just fine :)

Except for the cutout, which is not the one I chose in the previous screen. See:

screen shot 2016-07-26 at 14 33 47

screen shot 2016-07-26 at 14 33 51

avorio commented 8 years ago

I just added the script to populate the database to this branch. Let's get this deployed to master eventually so that the next review branches are built properly.

erasmus commented 8 years ago

@avorio seems like the migrate script didn't execute?

https://danandphil.herokuapp.com/artboard/v1469557043/l25nhleqyd1lmozcszzn.jpg/?cutout=dp-cutout4.png&text=go%20outside

avorio commented 8 years ago

You're right. It didn't. Damn it.

I just executed it manually now and the error 404 is back ON (as it should). All set.

erasmus commented 8 years ago

Do I need to run manually after each deploy? Because I get

screen shot 2016-07-26 at 20 27 38
avorio commented 8 years ago

Do I need to run manually after each deploy?

No, unless you've made changes to the database schema.

But leave that to me anyway, please; I'm the guardian of the models :)

Also, your syntax is incorrect. It's:

heroku run [command] --app [name of the app, e.g. 'danandphil']
erasmus commented 8 years ago

This may be why, the script didn't execute...

screen shot 2016-07-26 at 20 55 18
erasmus commented 8 years ago

There was a runaway comma in there...

avorio commented 8 years ago

Did you fix it?

erasmus commented 8 years ago

Yup

avorio commented 8 years ago

Ok, great!