Hacker News new | ask | show | jobs
by git-pull 3077 days ago
For bulletproofing, I do tests + mock network calls.

I use pytest with parametrize: https://docs.pytest.org/en/latest/parametrize.html

Then responses for mocking network stuff from requests: https://github.com/getsentry/responses

Using fixtures and writing your own factory objects to simulate scenarios: https://docs.pytest.org/en/latest/fixture.html. Fixtures in pytest are like setup/teardown.

I keep the code live in production, and have sentry errors email me if someone hits a snag.

Decouple generic code into separate git repositories. Split up billing / generic django / ux stuff so you don't need to repeat it with every website.

I maintain a changelog https://devel.tech/site/updates. Helps to stay motivated while you build out your own IP.

At work, when a project flops, the code tends to go to waste. When you write your own code, unencumbered by any outside agreements/conflicts, it stays with you to reuse, improve, license to others, turn into a SAAS, use in a separate website, etc.