Tag: coding

  • AWS: botocore.exceptions.NoRegionError: You must specify a region.

    AWS: botocore.exceptions.NoRegionError: You must specify a region.

    by

    in

    solution: export AWS_DEFAULT_REGION=us-west-2

  • How to assert 2 simple functions return the same value in Python?

    How to assert 2 simple functions return the same value in Python?

    by

    in

    To test that two functions return the same value, you can use the assert statement in Python. Here’s an example of how to do it: def function1(): return 5 def function2(): return 5 assert function1() == function2() In this example, we have two functions function1 and function2 that both return the integer value 5. We…

  • Python dict.get() vs dict[‘brackets’], which approach is better?

    Python dict.get() vs dict[‘brackets’], which approach is better?

    by

    in

    Using the .get() method on a dictionary is generally considered a better approach than using the direct dictionary indexing dictionary[‘key’] method because the .get() method provides a default value if the key is not found in the dictionary, whereas direct dictionary indexing raises a KeyError exception. Here is an example: my_dict = {‘a’: 1, ‘b’:…

  • Django tips and tricks

    Django tips and tricks

    When to use gettext() and gettext_lazy() Functions for TranslationAll of these snippets, Django tips and tricks have been tested on real-world Django applications by me. I’m using each of them in my SaaS projects. I wrote this article in a specific manner, less text – more code – more solutions! If you have any issue/error…

  • Python Programming Language 3.7 Cheat Sheet Image

    Python Programming Language 3.7 Cheat Sheet Image

    Python Programming Language 3.7 Cheat Sheet Image for beginners and people who want to find out what’s new on Python 3.7

  • Matplotlib and Bokeh Cheat Sheet, Python Programming language

    Matplotlib and Bokeh Cheat Sheet, Python Programming language

    The matplotlib cheat sheet was created to help visualize data. Datacamp provides a cheat sheet describing the basics of seaborn. Seaborn is also a widely used library for data visualization with python. It allows getting a very clean chart with less code. Matplotlib is a plotting library for the Python programming language. The most used module of…

  • GITHUB GIT CHEAT SHEET PNG IMAGE

    GITHUB GIT CHEAT SHEET PNG IMAGE

    GitHub Git CHEAT SHEET. This cheat sheet features the most important and commonly used Git commands for easy reference. Git is software for tracking changes in any set of files, usually used for coordinating work among programmers collaboratively developing source code during software development. Its goals include speed, data integrity, and support for distributed, non-linear workflows. Wikipedia

  • Properly Run Python Django under a local network

    Properly Run Python Django under a local network

    by

    in

    First, you need to find your local IP address with this command in cmd: ipconfig/all Open settings.py and add your IP address to the ALLOWED_HOSTS list: ALLOWED_HOSTS = [‘192.168.xxx.xxx’] Finally run command in the terminal: python manage.py runserver 192.168.xxx.xxx:8000 Voila, now you can visit your Django app by accessing this address(192.168.xxx.xxx:8000) from any device in…