MS SQL Server with Django / SQLAlchemy

After searching some up-to-date information about the state of MSSQL support for Python (web development purposes mainly), I decided to take a closer look just by testing with the most promising libraries. Well, for Django at least there was only one library that I could find that has received ...

I've been using vim-fugitive for some time, but after its latest major update I started to dislike how it opens some views in new splits/buffers. I also had a project of figuring out what slows down my Vim, so I finally came up with simplified version of :Git command: https://gist.github.com ...

Summary:

Environment consists of one Nginx container and Django containers. Nginx is used as reverse proxy to pass on traffic to Django.

Quick summary:

  • Create Docker containers
  • Django applications load environment files (.env) from S3
  • Test locally with docker compose
  • Initialize Elastic Beanstalk (EB) environment
  • Create Dockerrun.aws.json for EB
  • Write file on "leader ...

I'm currently very excited about Zappa, mainly because of its ability to easily deploy Django to AWS Lambda. This post will be a collection of URLs to different tutorials and manuals about how to deploy Zappa and configure AWS VPC accordingly. I deployed https://www.kalakeitto.fi with it.

My main goal was to ...

Prerequisities

  • Python 3
  • AWS account

Step by step

1. Start initial Django project with cookiecutter-django

cd ~/virtualenvs
python3 -m venv cookiecutter
source cookiecutter/bin/activate
pip install "cookiecutter>=1.4"
cd ~/django-projects
cookiecutter https://github.com/pydanny/cookiecutter-django

Cookiecutter will ask a bunch of questions, but for the sake of this tutorial set project_name and ...

It's often best to check what is going to be deleted with obj.delete() before actually running it, and the way to do it can be found, for example, here: https://stackoverflow.com/questions/12158714/how-to-show-related-items-using-deleteview-in-django

TL;DR:

from django.contrib.admin.utils import NestedObjects
collector = NestedObjects(using='default')
collector.collect([obj])
collector.nested()