Skip to main content


Showing posts from January, 2021

Phaser 3 JavaScript and HTML5 Game Engine

  It's our test project. We made this game with my son over weekend. Have fun playing! :-) .. That's a really nice framework. We made something like this with minimum effort. I think this is very useful in web applications to add entertainment. Phaser is a mobile and desktop HTML5 game development engine based on the PIXI.js library. Supports Canvas and WebGL rendering, animated sprites, particles, audio, various input methods and object physics. The sources are available both for viewing and for free modification. It was created by Richard Davey, known for his active participation in the community of programmers using the Flixel framework. Richard does not hide that he was inspired by Flixel, so some of the things in Phaser will be familiar to experienced flashers.  

Error of a unique constraint in Django relationship and unique constraint postgres

Error of a unique constraint in django relationship, when you remove foreign key from code but it is not migrated via database migration tool. You can sometimes get IntegrityError very simply. It takes time to understand what actually went wrong. And when some mechanism works in a command it can lead to unexpected problems. Hanging objects in databases that are normally no longer new. If it is identified then that is easy to improve. A problem well stated is a problem half solved Bug in cyclus mailing. Check table constraints. \d+ cyclusemail_cyclus We see that index key on the table. But in code we have removed it and replaced it with a setter and getter something like this.. You can remove it manually from the database to fix this problem for example. ALTER TABLE cyclusemail_cyclus DROP CONSTRAINT cyclusemail_cyclus_job_id_62194efe_fk_job_job_id; ALTER TABLE table_name DROP CONSTRAINT constrain_name; Ok, it is fixed

Django python new app

It is always interesting as a first step to find out if you have ever made such an app. Or is there a good open source application somewhere that can solve your problem. Just be careful not to add unnecessary complex apps with security issues or other issues while you have very minor problems. The intention is to find a long-term solution and perform as little development as possible, because those are all extra hours. I always try to describe everything first in my head then in a document so that design is clear. I create a diagram in the form of Mindmap, Flowchart, Smart goals, and sometimes SWOT. If something is certain to be useful, you start with development. You can start without analysis if you are sure this site needs an app and you already know a good one that you just want to adjust or install. Then there is actually no new app, but just an install. I think no analysis is necessary in this case. Example: We need a contact form that is linked to products. It does not matter w

Django custom template tags and filters

     Your custom tags and filters will live in a module inside the templatetags directory.     vim job/templatetags/   Code Example:   import re from django import template from django.template.defaultfilters import stringfilter from datetime import datetime, timedelta from django.conf import settings register = template.Library()      @register.filter(is_safe=True) @stringfilter def cleandesc(value, arg):     """     {{ var|cleandesc:"bar" }}     """     arg = arg.strip()     clean_text = value     try:         clean_text = clean_name(value, arg)     except:         pass     clean_text = clean_text.replace(arg, "")     clean_text = re.sub(r'[\w\-][\w\-\.]+@[\w\-][\w\-\.]+[a-zA-Z]{1,4}', '', clean_text) # email        try:         clean_text = replace_banned_keywords(clean_text)     except:         pass     return clean_text   To load a filter or tag. Note application must already be installed in django set