Rasul Kireev

Indiehacker. Aspiring Data Scientist. Love to try new things. I also write occasionally.

About, Writings, Reading, Now, Learning


This is what learnt the week of July 22, 2019

Figured out how to write custom template tags and display a number of latest posts on a home page (in Django)

The problem with that was that Django doesn't have a ready built-in functionality (as far as I can tell) which allows you to view multiple models on a single (e.g "home") page. In reality it doesn't need to because you could easily write a custom template tag that will do that for you. It actually wasn't that hard. The hardest part was to realize that a custom template tag is exactly what I need. (Some heavy googling and stackoverflowing went into discovering this).

Configuring nginx.conf such that I can upload large files (photos) through the website.

I kept getting an error when trying ti uplkoad images larger than 1mb. I thought the problem was with the php.ini file, even though I have managed all the setting there. The problem was with the nginx configuration. Apparently one needs to set the max upload size there too. That was not in any of the nginx instructions.

Giving special permissions to my virtual environment in Django project

This gave me a lot of trouble in the past where I got a lot of errors and could not install requirements.txt without using –user commad or sudo, which defeats the purpose of having a venv.

sudo chown -R your_username:your_username path/to/virtuaelenv/

Using Django along with Postgres and PostGIS to create the project I had in mind for a while now

There is a lot to learn here, but knowing such ability exists is already a big step for me.

Discovered http://Coda.io" target="_blank">Coda.io for project tracking

Coda is a very powerful tool for doc creation. It is like a combination of all Google Docs in one form. Actually, this explanation does not do Coda any good. You just have to check it out for yourself. They have a ton of useful templates you can see for your self. I personally use it as a “Project” “Bullet Journal”

What “POST” and “GET” refer to in the world of Web Development

These are just type of forms an admin can setup (please correct me if I am wrong). For example, I would use “GET” if the form triggers the script on the server that calculates using user input and returns some output. Whereas, “POST” will actually update something and the server to be then displayed in most cases, like a user submitted blog post.

Using Sentry for Error Tracing

Sentry is very cool! It is like having Debug=True, but securily. This allows you to understand any of your errors. For example, if your server gives you “Server Error 500” you would have no idea what exactly caused this. The best thing is how easy it is to integrate into your project (Django for me).

Grouping Database output using built-in Django templates.

Once you know what you need, this function will work perfectly for you. Django dev team took care of most of needs you might have with this template tag.

href="https://docs.djangoproject.com/en/2.2/ref/templates/builtins/#regroup" target="_blank">https://docs.djangoproject.com/en/2.2/ref/templates/builtins/#regroup