(the suggested url: I saw it before writing the message. It is outdated. Example: It uses "python manage.py syncdb"
Besides: It instruct adding to INSTALLED_APPS : " 'registration'": This yield errors: First reason: A comma is missing..
I also think, but not sure,that this line is not relevant anymore..)
I now see that I get an error message with runserver:
ModuleNotFoundError: No module named 'django_registration.backends'
That has to do with addition added to url.py under urlpatterns
The line cause the error message is:
url(r'^accounts/', include('django_registration.backends.activation.urls')),
while the following line works fine.
url(r'^accounts/', include('django.contrib.auth.urls')),
Note that url.py exists at Python37-32\Lib\site-packages\django_registration\backends\activation
I am new to django still could not making the error to go away. I noticed that there are no __init__.py files at "lib" as well as at "site-packages".
(I could not believe it is the reason for the error and nor that I should make changes there but I tried adding empty __init__.py anyway...)
So what should I do to resolve the ModuleNotFoundError: No module named 'django_registration.backends' error?
On Sun, Dec 30, 2018 at 7:41 PM Yuval Bachrach <yuval.bachrach@gmail.com> wrote:
First: thank you!Yes I did search before askingI was trying to place the templates under my project tree (rather than under "Python37-32\Lib\site-packages\django\contrib\admin\templates\registration" and could not make it work.Per you advice I also tried putting the template file at the above mentioned directory as a temporary solution but I still get the same error message.On Sat, Dec 29, 2018 at 5:45 PM Zhe Li <lizhe05@gmail.com> wrote:--Have you searched the internet before posting?https://stackoverflow.com/questions/6127264/troubleshooting-templatedoesnotexist-at-accounts-login-django-auth-setupYou can either create your own pages or copy the whole templates under the django admin site -- site-packages/django/contrib/admin/templates/registration/
On Saturday, December 29, 2018 at 10:22:11 AM UTC-5, Yuval Bachrach wrote:I have installed "django-registration:" and now follow "https://django-registration.readthedocs.io/en/3.0/quickstart.html"I have set URLs as explained (see below) but failed to tell django where to find the templates.What do I need to do to have django find the templates?More details:
is resulted with an error:TemplateDoesNotExist at /accounts/register/
django_registration/registration_form.html
Request Method: GET Request URL: http://127.0.0.1:8000/accounts/register/ Django Version: 2.1.3 Exception Type: TemplateDoesNotExist Exception Value: django_registration/registration_form.htmlException Location: C:\Program Files (x86)\Python37-32\lib\site-packages\django\template\loader.py in select_template, line 47 Python Executable: C:\Program Files (x86)\Python37-32\python.exe Python Version: 3.7.1 I have tried to locate registration_form.html at django_reistration/reister/templates at "django_registration\registration\templates\registration" under my project.Also tried "django-registration\registration\templates\registration" and several other locations but I keep getting the error message.The problem could be the template location or a missing setting,...
- I added no app to the "INSTALLED_APPS" at setting.py
- my template is:
TEMPLATES = [{'BACKEND': 'django.template.backends.django.DjangoTemplates',# changed at tutor7# 'DIRS': [],'DIRS': [os.path.join(BASE_DIR, 'templates')],# DIRS is a list of filesystem directories to check when loading Django templates; it’s a search path'APP_DIRS': True,'OPTIONS': {'context_processors': ['django.template.context_processors.debug','django.template.context_processors.request','django.contrib.auth.context_processors.auth','django.contrib.messages.context_processors.messages',],},},]from django.conf.urls import include, url urlpatterns = [ # Other URL patterns ... url(r'^accounts/', include('django_registration.backends.activation.urls')), url(r'^accounts/', include('django.contrib.auth.urls')), # More URL patterns ...--
Yuval B
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/a0f6a2f7-455d-4cdc-985d-acc8a810daf4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
Yuval B
Yuval B
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAD16PYTgmMvHunx9r91JSfv4OkS45k89E5JqPEJxCMjhsKOgBg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment