Cannot resolve manager type when using django-polymorphic with mypy django-stubs - django

I'm trying to use django-polymorphic to extend a DRF project that uses typeddjango with mypy-stubs. I recently started to use PolymorphicModels and mypy instantly started to complain and throw errors:
error: Could not resolve manager type for "<MyModel>.objects"
I included "polymorphic" and "django.contrib.contenttypes" in the INSTALLED_APPS of the project, and can't really make sense of why mypy keeps complaining. I read about inherited managers in the django-polymorphic doc which could be a cause for troubles, but I didn't manage to identify the root cause to find a fix.
I opened a ticket here: https://github.com/typeddjango/django-stubs/issues/1158 with more details.
If anyone has some info, I'd love to hear..

Related

No module named 'django.conf.urls.defaults'

I upgraded from django 3.2.5 to django 4.0.4.
I know that this 'django.conf.urls.defaults' must be deprecated.
My problem is that I don't get this error in the development environment but when I push to production, it shows the error. Why is this so???
Also I tried to locate the file so that I can change that line of code to the correct one but could find it's location. It's giving me this path which I can't see how to get to (/workspace/.heroku/python/lib/python3.9/site-packages/django/conf/urls/__init__.py))
After trying all the possibles at my level , I had to revert to django 3.2.5

can't import the test helper addon in ember-cli-mirage

Facing the same issue - https://github.com/miragejs/ember-cli-mirage/issues/1445
Uncaught Error: Could not find module project-name/tests/helpers/push-mirage-into-store imported from project-name/mirage/factories/addon
Initially got this error and tried #makepanic instructions
After that
Uncaught Error: Could not find module #ember/test-helpers imported from project-name/mirage/helpers/push-mirage-into-store
can you pls help here to resolve this.
I bet you are running into the error, which is described in this comment by makepanic in the GitHub issue you linked:
When running the app directly, the browser opens index.html which
isn't loading tests.js. This file contains everything related to
tests.
If you open tests/index.html, that will also load tests.js and add any
modules under tests/* to the loader registry.
This means without the tests file loaded, you can't import anything
from tests/*.
You are affected by that issue if you face it when running ember serve.
The comment also includes a possible solution:
With you moving the helpers to /mirage, they gets registered in both index.html and tests/index.html.
An alternative would be to disable mirage in all enrironments except for test. But that is only a feasible solution if you use mirage only for testing but not for development.

Django 1.7 makemigration Hang

I am trying to get on Django 1.7, and following the instructions here. Unfortunately, the process seems to be hanging with the output below:
[Watt] ~/Projects/proj/proj master > python proj/manage.py makemigrations
/home/me/.virtualenvs/myvenv/local/lib/python2.7/site-packages/django/contrib/comments/__init__.py:13: RemovedInDjango18Warning: django.contrib.comments is deprecated and will be removed before Django 1.8.
warnings.warn("django.contrib.comments is deprecated and will be removed before Django 1.8.", RemovedInDjango18Warning)
/home/me/.virtualenvs/myvenv/local/lib/python2.7/site-packages/mptt/managers.py:36: RemovedInDjango18Warning: `TreeManager.get_query_set` method should be renamed `get_queryset`.
class TreeManager(models.Manager):
/home/me/.virtualenvs/myvenv/local/lib/python2.7/site-packages/tagging/forms.py:12: RemovedInDjango18Warning: Creating a ModelForm without either the 'fields' attribute or the 'exclude' attribute is deprecated - form TagAdminForm needs updating
class TagAdminForm(forms.ModelForm):
/home/me/.virtualenvs/myvenv/local/lib/python2.7/site-packages/mptt/admin.py:15: RemovedInDjango18Warning: `MPTTChangeList.get_query_set` method should be renamed `get_queryset`.
class MPTTChangeList(ChangeList):
What should I do to diagnose the hang? Could this be a function of some of the dependencies being out of date for 1.7?
As mentioned in this answer, you should try running the migrations one by one for the core Django packages, then your own apps and finally for the 3rd party dependencies. I upgraded them to the latest stable versions as well - this might have helped.
Nothing there is hanging. Those are all warnings about deprecated functions that will be removed in Django 1.8. So, you need to investigate your usages, determine what the new guidance is, and make the updates before installing Django 1.8. For the time being, in Django 1.7, you should be okay.

django, haystack, and pyelasticsearch best versions

Basically, I am getting a unreasonable amount of errors using these libraries:
django==1.4.3
pyelasticsearch==0.6
simplejson==3.3.0
django-haystack==2.1.0
The errors I get are:
From python2.7/site-packages/haystack/query.py:
index_queryset() got an unexpected keyword argument 'using'
I just remove this and it works locallay
/srv/www/projects/k-state-union/lib/haystack/backends/elasticsearch_backend.py:
raise MissingDependency("The 'elasticsearch' backend requires the installation of 'pyelasticsearch'. Please refer to the documentation.")
This error occurs when pyelasticsearch fails to be imported. If I let it fail naturally:
/srv/www/.virtualenvs/k-state-union/lib/python2.6/site-packages/pyelasticsearch/client.py:
from simplejson import JSONDecodeError
Which works in the python interpreter.
The errors seem to indicate that I am not using the intended versions of pyelasticsearch and haystack. What do I need to do to get this up and running?
There are two different python libraries for Elasticsearch out there. I switched from pyelasticsearch to elasticsearch and it worked.

Module unittest Kohana error, how to use?

I am trying times longer run it has several errors. Someone
has any tutorial or some way to make it work. Tested
several tutorials and I could not.
vlw staff
I already placed the php unittest unit in the directory.
the error is as follows:
Fatal error: main() [function.require]: Failed opening required
'PHPUnit/Util/Filter.php' (include_path='.;C:\php5\pear') in C:\wamp
\www\doeseulixo\branches\module_unittest\modules\unittest\PHPUnit
\Framework.php on line 0
See Installing PHPUnit.
PHPUnit should be installed with the 'pear' utility rather than downloaded manually. Kohana needs access to more than one class of the library.