So I've installed django-registration through easy_install. I'm following a quick start guide and I'm trying to setup my urlConf, however it says module named backends.defauls.urls is not found. What might be the problem ?
import registration
(r'^accounts/', include('registration.backends.default.urls')),
(not my solution, but since it was hidden in a comment)
You need to use use include('registration.urls'),
instead of include('registration.backends.default.urls')
Is the registration module in your PYTHONPATH?
I'd suggest always getting django-registration from Bitbucket: https://bitbucket.org/ubernostrum/django-registration/overview.
I had a similar problem where I installed django-registration using pip install and it wasn't giving me up-to-date code.
I had the same problem. Apparently the server where I'm trying to upload the urls.py script has an older version, 0.7 I think.
My initial workaround was to put django-registration as an app (from the source) and include it in INSTALLED_APPS, with the registration folder right alongside my other apps.
Then the new problem was that the installed version is being looked up before the 'custom' app, especially on imports. For example, in views.py, we have an
from registration.backends import get_backend
which seems to be missing from the 0.7 version. So this raises an exception, but checking on the registration app the function is there in registration/backend/init.py.
This causes clashes between the custom registration app (0.8) and the one installed server-wide (0.7) that I can't seem to get around to.
Related
So I updated my python code to Django 4.0 and with that, had to remove and update some deprecated code as "ungettext_lazy" and similar.
Locally, the code is compiling well but when I push it to heroku, I get this error:
from django.utils.translation import ungettext_lazy
ImportError: cannot import name 'ungettext_lazy' from 'django.utils.translation' (/app/.heroku/python/lib/python3.9/site-packages/django/utils/translation/__init__.py)
I've tried a few things but haven't been able to update this on heroku.
Basically solved it by removing the django-url-filter lib as it's not supporting django 4.0. Since I only used it for a small piece of code, it was better to remove it.
I solved this issue by swaping manually on requirements.txt Django==4.1 to Django==3.2.
When I run from flask.ext.mysql import MySQL I get the warning Importing flask.ext.mysql is deprecated, use flask_mysql instead.
So I installed flask_mysql using pip install flask_mysql,installed it successfully but then when I run from flask_mysql import MySQL I get the error No module named flask_mysql. In the first warning I also get Detected extension named flaskext.mysql, please rename it to flask_mysql. The old form is deprecated.
.format(x=modname), ExtDeprecationWarning. Could you please tell me how exactly should I rename it to flask_mysql?
Thanks in advance.
flask.ext. is a deprecated pattern which was used prevalently in older extensions and tutorials. The warning is telling you to replace it with the direct import, which it guesses to be flask_mysql. However, Flask-MySQL is using an even more outdated pattern, flaskext.. There is nothing you can do about that besides convincing the maintainer to release a new version that fixes it. from flaskext.mysql import MySQL should work and avoid the warning, although preferably the package would be updated to use flask_mysql instead.
flask.ext.X is the old form to import a Flask extension, it is deprecated since Flask v0.10. The new way is to use flask_X. That's why you got the first warning.
But apparently, Flask-MySQL does not update it's name form and use the flaskext as the package name (chedck it on GitHub). That's why you got the second warning.
You could have seen the question so many times.
But unluckily I cant solve this error.
I am using python 2.7.12 , django 1.8
The tutorial source I learn is Mozilla django development where they teach with latest version of python3 and django 1.10
Somehow I tackled to use with older version.
everything was going good until I started to import models to admin.
soem class codes started showing that it has no object member, even though it exist
and hence I finally got the error as
"ImportError: No module named locallibrary.settings"
Here what I tried:
Updated to python 3(thought that could be the problem)
appended correct sys path() with project path.
Still same error showing up
Anybody help me out for solving the issue.
If you are trying to import the settings of your project, try importing
from django.conf import settings
I am trying to run an existing django app. The app has been built in django-1.10. I set up a new virtualenv and installed the requirements and everything. However, I get errors like the following:
from django.utils import importlib
ImportError: cannot import name importlib
Now, the above is from the following source - .virtualenvs/crowd/lib/python2.7/site-packages/account/conf.py
When I manually fix the conf.py file, I still keep getting errors to fix either deprecated or removed features from older django versions.
Any idea as to how to fix this? I thought the purpose of working in virtualenvs was to avoid such errors.
Any suggestions would be much appreciated. Thanks in advance!
This is how the question is different: Even after I fix the importlib import statement, it keeps giving me errors like that of the usage of SubFieldBase and so on.
The problem was not with the Django-core but with django-user-accounts app that was included with pinax. Upgrading the django-user-accounts app fixed the issue.
Thanks to #Selcuk for the solution.
i am working on a simple employee listing Django application. i wanted to include filtering in my app, so tried installing django-filter module. i think django-filter is not installed properly ( i am not going to use it anyway). But after doing this, when i try to run my application, it gives this ,
"`ViewDoesNotExist at /employeeList/` ;
Could not import task.employeeDetails.views. Error was: Could not find the GEOS library (tried "geos_c", "GEOS"). Try setting GEOS_LIBRARY_PATH in your settings "
. while i searched for the error,came to know the error is due to some wrong geoDjango installation. But i dont need geoDjango and i am wondering how its throwing this error. Before doing this, my app was working fine. Somebody please help me to solve this problem.
Things to check:
Are you using the GeoDjango database classes? If your database engine is set to something like django.contrib.gis.db.backends.postgis or django.contrib.gis.db.backends.mysql, those are the geo backends. What you want is something like django.db.backends.postgresql_psycopg2 or django.db.backends.mysql. Not the lack of the "contrib.gis" part.
The other most likely possibility is that task.employeeDetails.views is importing or running something that requires GEOS.