Using cookiecutter to create simple hosted aiohttp web application
We will be using cookiecutter package to quickly spin up a simple web application using next stack: Python 3 + aiohttp + npm + Heroku. The main advantages of this approach is to have working and deployed application in couple of minutes. The only thing left is to update your business logic on back-end and to rearrange components on your html pages using one of the simplest css frameworks (siimple).
If you do not have those yet make sure all of the dependencies are installed first
$ pip install pipenv
That should be enough to start.
Clone preexisting boilerplate code from github and answer couple of questions about your future project and you’ll be good to go. Let’s assume that our project name is
$ git clone email@example.com:bmwant/templio.git
Check and verify that our project works locally and everything is in place by launching it
$ pipenv shell
127.0.0.1:8081 in your browser and that’s it.
$ heroku login # just one to sign into your account
Now you can access your web application at
https://myapp.herokuapp.com/ and share that link with others!
Your regular developing workflow would look like this:
- Make some changes locally (e.g. add new endpoints/templates)
- Test modifications locally (via
- Commit changes to git repository
- Deploy changes to remote (
git push heroku master)
Basically, it’s everything you need to now at this point to have a ready-to-go web application. You can fork
templio project and edit it according to your taste making it easier to create new projects from a scratch a lot faster than before.