cannot import name 'url' from 'django.conf.urls' - python

I have been trying to makemigrations in my django project but I keep getting this error constanly even though I'm using path instead of url can someone please help me? The error is being caused by the froala_editor path but I don't understand why.

as per django docs here:
django.conf.urls.url() was deprecated since Django 3.1, and as per the release notes here, is removed in Django 4.0+.
so you cannot use fedora_editor with django 4

Related

ImportError: No module named engine - Django suit related?

I am using Django and Django Suit V2 -
I am trying to create a custom home page for my django site using templates.
I keep getting this error: File "/usr/local/lib/python2.7/dist-packages/suit/apps.py", line 89, in add_suit_default_template_tags from django.template.engine import Engine
ImportError: No module named Engine
I want to make sure of what I'm doing before I go in and mess with the main files.
Anyone else deal with "No module named Engine" error before? Any Suggestions?
UPDATE - ok I corrected the first issue - I made sure the python interpreter was pointing to the virtualenv (it was already activated, so I deactivated and then reactivated). Was able to do a collectstatic with no error. I have now generated a different error which I will post in a different question since it's not directly related here. :)
It sounds like you have an old version of Django installed. The import
from django.template.engine import Engine
should work in Django 1.8+.

ImportError: cannot import name memoize

I have a little problem with project upgrade from Django 1.7.1 to 1.9.0.
Every 'RemovedInDjango20Warning' has been fixed, but one thing still left and I don't know how to deal with it.
When I'm trying to visit any page, there is always an ImportError like:
**TemplateSyntaxError at /auth/**
'crispy_forms_tags' is not a valid tag library:
ImportError raised loading crispy_forms.templatetags.crispy_forms_tags:
cannot import name memoize***
I have included {% load crispy_forms_tags %} in my template site, and added 'crispy_forms' in INSTALLED_APPS in settings.py
I tried to find any solution, but without success, before the update worked fine.
What am I doing wrong?
The reason for this error, as has been stated, is that Django dropped memoize at some point, so the version of crispy-forms you were trying to use was not working with the Django version.
Solutions include trying a different version of Django, or trying a different version of crispy-forms. If you are using an unreleased version of Django, then there may not be a version of cripsy that supports it (yet).
However, your error ("cannot import name memoize"), can show up for released versions of Django - I had that error, and a search lead me to this ticket. The issue was that i was using an old version of crispy (1.4.1), and a recent version of Django (1.11.1).
To find a version of crispy to use, you can check the github release page:
https://github.com/django-crispy-forms/django-crispy-forms/releases
The release comments include some information about the Django version supported by different releases.

django deprecation warning location

I am getting a deprecation warning while running tests for an app that I have installed/used in a django site. The deprecated feature is django/utils but the actual file that was using the deprecated feature is not given. Is there a way to get django to tell me which file is giving the deprecation warning or do I have to manually go through every single file in the app to find the reference? I am still new to testing in Django so I appreciate the help very much.
Run python using error warnings to give you full traceback:
python -Werror ./manage.py runserver # or whatever command gave the error
and you should be able to track down where it's coming from.
The dupe you mentioned will also work.

cannot import name LOOKUP_SEP

I'm using django and I'm trying to set up django-roa but when i'm trying to start my webserver I have this error cannot import name LOOKUP_SEP
If I remove django_roa from my INSTALLEDS_APP it's okay but I want django-roa working and I don't know how resolve this problem.
And I don't know what kind of detail I can tell to find a solution.
Thanks
This question is the top Google search result for "cannot import name LOOKUP_SEP", therefore although it doesn't necessarily solve any other compatibility issues between django-roa and Django 1.5 I want to point out...
You can solve this (specific) error by replacing:
from django.db.models.sql.constants import LOOKUP_SEP
with:
from django.db.models.constants import LOOKUP_SEP
django_roa is not yet compatible with django 1.5. I'm afraid it only works with django 1.3.
I downgraded from 1.5.2 to 1.4.0 and my app started working again. Via pip:
pip install django==1.4
Hope that helps.

I have trouble installing the django-socialregistration app!

I'm a Django amateur, and have problems getting django-registration to work. I followed the installation instructions on their website, but for someone like me these instructions are not 100% clear as to what I should be doing. Here is what I've done:
I installed the oauth2 and python-openid packages using pip. I then copied the facebook.py file from the facebook-python-sdk package to my main django app directory. (As I write this, I'm wondering whether this file should be copied to the socialregistration app directory? Does it make a difference?)
I copied the socialregistration directory to my django project's directory.
I added socialresgitration to my INSTALLED_APPS setting.
To add socialregistration.urls to my urls.py file, I added the following line (not sure if this is correct, since the instructions don't give details):
(r'^social/', include('socialregistration.urls')),
I added the facebook API key and secret key to my settings
I added socialregistration.auth.FacebookAuth to AUTHENTICATION_BACKENDS.
I added socialregistration.middleware.FacebookMiddleware to MIDDLEWARE_CLASSES.
Finally I added the three facebook tags they give in the instructions to one of my templates.
When I then load my website, I get the folllowing error:
Caught AttributeError while rendering: Please add the django.core.context_processors.request context processors to your settings.TEMPLATE_CONTEXT_PROCESSORS set
So, what can I do? I thought installation would be quite simple, but apparently this is not the case. ANY help would be appreciated!
Oh, BTW, I'm using Django 1.2.1 and Python 2.6.
Thanks!
Please add the django.core.context_processors.request context processors to your settings.
Have you done that?
You'll need to change TEMPLATE_CONTEXT_PROCESSORS to include django.core.context_processors.request.
I've found the problem. When my view renders the template, it needs to pass the RequestContext to the template.
return render_to_response('my_template.html', my_data_dictionary, context_instance=RequestContext(request))
Source: http://lincolnloop.com/blog/2008/may/10/getting-requestcontext-your-templates/

Categories

Resources