Categories
Mastering Development

Wine not running on google cloud run

This is my docker file, which is installing wine in order to run some exes that I want to, on Google cloud run: ARG BASE_IMAGE="ubuntu" ARG TAG="latest" FROM ${BASE_IMAGE}:${TAG} # Install prerequisites RUN apt-get update \ && DEBIAN_FRONTEND="noninteractive" apt-get install -y –no-install-recommends \ apt-transport-https \ ca-certificates \ cabextract \ git \ gosu \ gpg-agent \ […]

Categories
Mastering Development

RecursionError at /graphql. maximum recursion depth exceeded

Problem Definition: I have read the article about adding JWT authentication my project using graphene-jwt package from this official link. According to what is said in the tutorial, some changes should be applied to the project settings.py file: First of all the package should be installed: pip3 install django-graphql-jwt Add AuthenticationMiddleware to MIDDLEWARE variable. MIDDLEWARE […]

Categories
Mastering Development

Django cannot find GDAL on windows 10 64 bit

I am using PyCharm and Python 3.8 – 64 bit. I am trying to learn to implement GeoDjango and Leaflet with a Postgis database. I have a postgresql database with postgis extension. I also have psycopg2 installed following the comments from this earlier thread of mine. psycopg2 not detected by postgres django In settings.py, DATABASES […]

Categories
Linux Mastering Development

Can’t start virt-manager due to python errors: EOFError: marshal data too short

I have been happily using KVM and virt-manger on Arch Linux for about a year now. This morning, one of my VMs broke (that is another story which I don’t think is related), and I decided that it would just be easiest to delete it and virt-install again. However, after deleting this VM via the […]

Categories
Mastering Development

RuntimeError: __class__ not set defining ‘AbstractBaseUser’ as

I’m getting this error while trying to migrate databases after manually setting up PostgreSQL database for the project. I was trying to run the cloned quora project forked from github when this error cropped up. Follow the full error description: RuntimeError: __class__ not set defining ‘AbstractBaseUser’ as <class ‘django.contrib.auth.base_user.Abstract BaseUser’>. Was __classcell__ propagated to type.__new__? […]

Categories
Linux Mastering Development Ubuntu

Upgrade to Ubuntu 20 breaking mysqlclient pip package

Watching for file changes with StatReloader Exception in thread django-main-thread: Traceback (most recent call last): File “/home/tom/cs344/group8-rw334-project-2/venv/lib/python3.7/site-packages/django/db/backends/mysql/base.py”, line 16, in <module> import MySQLdb as Database File “/home/tom/cs344/group8-rw334-project-2/venv/lib/python3.7/site-packages/MySQLdb/__init__.py”, line 18, in <module> from . import _mysql ImportError: libmysqlclient.so.20: cannot open shared object file: No such file or directory The above exception was the direct cause of […]

Categories
Mastering Development

djangocms – cannot import name ‘NamespaceAlreadyRegistered’

I have developed a simple project with DjangoCMS(3.7.2) and it works great in the local. I ‘m gonna run it on a ubuntu server, which I have another Django project run on it with no issues. Both of my projects are built using python 3.6 & MySQL database. I took these steps to run my […]

Categories
Mastering Development

Unable to pass arguments in python3 class

Firstly, I created a class that has __init__() on it in models.py, as you can see below. And when I import it in my views.py, the vscode intellisense also shows that my class takes 4 arguments. But when I try to run the program, it shows me an error saying that the class doesn’t take […]

Categories
Mastering Development

super().__init__(*args, **kwargs) TypeError: __init__() got an unexpected keyword argument ‘max_lenght’

Traceback (most recent call last): File “manage.py”, line 21, in <module> main() File “manage.py”, line 17, in main execute_from_command_line(sys.argv) File “C:\Users\MobilineWest\AppData\Local\Programs\Python\Python38-32\lib\site-packages\django\core\management\__init__.py”, line 401, in execute_from_command_line utility.execute() File “C:\Users\MobilineWest\AppData\Local\Programs\Python\Python38-32\lib\site-packages\django\core\management\__init__.py”, line 377, in execute django.setup() File “C:\Users\MobilineWest\AppData\Local\Programs\Python\Python38-32\lib\site-packages\django\__init__.py”, line 24, in setup apps.populate(settings.INSTALLED_APPS) File “C:\Users\MobilineWest\AppData\Local\Programs\Python\Python38-32\lib\site-packages\django\apps\registry.py”, line 114, in populate app_config.import_models() File “C:\Users\MobilineWest\AppData\Local\Programs\Python\Python38-32\lib\site-packages\django\apps\config.py”, line 211, in import_models self.models_module = […]

Categories
Mastering Development

python pip corrupted, can’t repair or uninstall

Due to a series of events described later I am getting the following error in the command prompt whenever I try to do anything with pip. (venv) (base) C:\Users\Mark Kortink\Dropbox\Python\projects\metapplica>pip install flask Traceback (most recent call last): File “C:\ProgramData\Anaconda3\lib\runpy.py”, line 193, in _run_module_as_main “__main__”, mod_spec) File “C:\ProgramData\Anaconda3\lib\runpy.py”, line 85, in _run_code exec(code, run_globals) File “C:\Users\MARKKO~1\Dropbox\Python\projects\METAPP~1\venv\Scripts\pip.exe\__main__.py”, […]