Saturday, 28 April 2012

Creating a Python App on Heroku

Need a requirements file containing all items plus:


Plus a Procfile:
web: gunicorn app:app -b$PORT -w 3

Then you just go:
heroku login
heroku create --stack cedar
git push heroku master
heroku ps:scale web=1

Saturday, 31 March 2012

Windows Command Line History in CMD.EXE

I just found out about these!

  • F1: Pastes the last executed command (character by character)
  • F2: Pastes the last executed command (up to the entered character)
  • F3: Pastes the last executed command
  • F4: Deletes current prompt text up to the entered character
  • F5: Pastes recently executed commands (does not cycle)
  • F6: Pastes ^Z to the prompt
  • F7: Displays a selectable list of previously executed commands
  • F8: Pastes recently executed commands (cycles)
  • F9: Asks for the number of the command from the F7 list to paste

Installing Python nicely on Windows box

At the time of writing despite x64 Windows use Python 2.7 (not 3.0) and x86 (not x64).
The Windows virtualenv wrapper notes are here:

At this point ready to use VirtualEnv, along with requirements files etc. I suppose the process might look something like this:

  • make project folder new_proj
  • cd into new_proj
  • make requirements.txt
  • edit requirements.txt add say "flask"
  • mkvirtualenv new_proj_env
  • pip install -r requirements.txt
Additionally the postgres database driver might be required. This is in combination with a local installation of Postgres.