Most of the following reference URLs are plagiarized. A memorandum for myself when I first touched heroku before.
Reference URL: http://momoto.github.io/blog/2013/08/16/deploying-django-1-dot-5-2-on-heroku/
I suddenly stumble here.
(venv) $ pip install django-toolbelt
Error: pg_config executable not found.
What is pg_config? When I looked it up, it seems to be a file that contains the version information of the installed PostgreSQL. reference:
So, install PostgreSQL with homebrew. Reference: http://qiita.com/youcune/items/5b783f7fde45d0fd4b35
$ brew install postgresql
This is a safe breakthrough.
What is pip freeze?
(venv) $ pip freeze > requirements.txt
Reference URL: http://tdoc.info/blog/2014/01/15/pip.html> freeze can be written to a file as standard output and can be used later for install or bundle.
And that.
I did the procedure and git push heroku master, but I get an application error.
Check the log.
(venv)$heroku logs
...
2014-03-09T00:36:57.628732+00:00 app[web.1]: ImportError: No module named side_dish.wsgi
Yup. It seems that side_dish.wsgi is missing ... It may have been wrong at the environment construction stage.
That's why I started over from the beginning. Next time, I will try it while looking at the official document. Official documentation: https://devcenter.heroku.com/articles/getting-started-with-django
Then, such a note.
Don't forget the . at the end. This tells Django to put the extract the into the current directory, instead of putting it in a new subdirectory.
(venv)$ django-admin.py startproject hellodjango .
I didn't put it on.
This completes the confirmation that it is working for the time being. After all, you should read the official document without getting tired of English.
After doing the above for a while, heroku's command stopped working.
(venv)$ heroku ps
! No app specified.
! Run this command from an app folder or specify which app to use with --app APP.
It seems that you should specify the name of APP and execute it.
(venv)$ heroku open --app radiant-depths-6246
Opening radiant-depths-6246... done
Reference URL: https://devcenter.heroku.com/articles/renaming-apps#manually_updating_a_git_remote
$ heroku apps:rename newname
With this, APP will be renamed, but CheckOut will run automatically. The following command does not check out.
$ heroku apps:rename newname --app oldname
Change the remote URL used by git with the following command.
$ git remote rm heroku
$ heroku git:remote -a newname
You may want to experiment with the console on heroku, but don't leave it connected to heroku all the time with `` `$ heroku run console```. During that time, it will be converted into usage time, so be careful as it may exceed the free usage time allowance (750 hours). Reference URL: http://blog.mah-lab.com/2013/05/16/heroku-commons-16/
I want to use sqlite in the local environment (development environment). If you identify from the environment variables, you can switch the DB between heroku and the local environment.
$ export LOCAL_ENV=LOCAL_ENV
Reconfigure the DB environment by referring to the settings.py of the reference URL. If the environment variable added earlier exists, it is determined as the local environment and the database is set to sqlite3.
Reference URL: http://source.hatenadiary.jp/entry/2013/02/05/173636
Recommended Posts