1. The test-driven idea above is a really good one.
I find a combo of running tests and auto-docs to be
Powerful in keeping me motivated. Python doctest, sphinx
Are excellent
2. MVP and focus - really choose one small thing and ship it
Script your deployment process so you can in one day write a function run the tests then push it live. That will seriously motivate you
3. Outside help - know anyone else who might work with you? There is a very good reason pg says solo founders don't work well. The motivation levels needed are huge.
4. Put time aside in the week to see your girlfriend (over a table, with a candle, just on the sofa does not count). Similar with family friends. Don't go mad on this try a date night each week and a friends night. Your social life may improve (depends where you are now I guess)