So I’ve decided to try (again) to learn how to code a full Web Application in Python using Django as the framework.
The number of false starts in my endeavour is enough to make me discouraged, but I just can’t totally let it go and I seem to keep coming back to it. Somehow, the desire to actually build something is still there, and I’m just hoping that this time I get somewhere. I’m blogging this experience in part to keep myself in check, and to also document some of my learnings so that I can always come back to it.
I would’ve loved to be coding on a MacBook, but I don’t have one and until I reach a stage where it would be more productive for me to get one, it would make more sense for me to continue using the existing Windows based laptops I have.
First, a few things I’ve (re)learned:
- Use pip to install virtualenv in Windows Subsystem for Linux (WSL or Windows Bash). Using Virtual Environment to manage Python Environments and versions are essential to making sure your development environment is consistent. It should essentially be part of your workflow.
- Context syntax for multiple variables is as follows: { ‘var_name’: ‘value’, ‘var_name2’: var}
- Context syntax for dictionary is as follows: {‘dictionary_name’: {‘var_name’: ‘value’}}
- Use “django.shortcuts import render” and then “return render(request, ‘template.html’, {‘context’: bar})”
Ok that’s about as far as I got. Considering it’s only a few hours in, with so much more to go, I really needed to put this down so I can make sure I keep going. At least it’s a start.
Next step is Apps and Migrations within a Project.