'URLPattern' Object is not a mapping

104 views
Skip to first unread message

Tina Upadhyay

unread,
Feb 26, 2019, 7:21:20 AM2/26/19
to Django users
Getting this error and the urls.py of my model is as shown below:


from django.conf.urls import url
from new import views
app_name = 'new'


urlpatterns = [
url(r'^export/csv/$', views.export_users_csv, name='export_users_csv'),
# url(r'^$', views.upload, name='uplink'),
url(r'^download/(.*)', views.download, name="download"),
url(r'^download_attachment/(.*)/(.*)', views.download_as_attachment,
name="download_attachment"),
url(r'^exchange/(.*)', views.exchange, name="exchange"),
url(r'^parse/(.*)', views.parse, name="parse"),
url(r'^import/', views.import_data, name="import"),
url(r'^import_sheet/', views.import_sheet, name="import_sheet"),
url(r'^export/(.*)', views.export_data, name="export"),
url(r'^handson_view/', views.handson_table, name="handson_view"),

# handson table view
url(r'^embedded_handson_view/',
views.embed_handson_table, name="embed_handson_view"),
url(r'^embedded_handson_view_single/',
views.embed_handson_table_from_a_single_table,
name="embed_handson_view"),
# survey_result
# url('^survey_result/',
# views.survey_result, name='survey_result'),

# testing purpose
url(r'^import_using_isave/',
views.import_data_using_isave_book_as),
url(r'^import_sheet_using_isave/',
views.import_sheet_using_isave_to_database),
url(r'^import_without_bulk_save/',
views.import_without_bulk_save, name="import_no_bulk_save")
]
2019-02-26 15_27_06-TypeError at _new_import_.png

ANIL UMARANE

unread,
Feb 26, 2019, 7:38:24 AM2/26/19
to django...@googlegroups.com
which version django you have used


--
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...@googlegroups.com.
To post to this group, send email to django...@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/0f17d0d5-3823-4fd1-a90f-5f2f96bdbbc6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

anthony....@gmail.com

unread,
Feb 26, 2019, 8:05:02 AM2/26/19
to Django users
Hi,

Django's version is in the screenshot (2.1.4)

anthony....@gmail.com

unread,
Feb 26, 2019, 8:21:35 AM2/26/19
to Django users
Hello,

Don't you have another urls.py file inside the directory that have the same name as your project.
Probably something like that:

+ yourproject
     + yourproject
          - __init__.py
          - settings.py
          - ....
          - urls.py
          - ....

If yes, what does it contain ? 
Furthermore, could you send us the full trace ? 

Thx

Tina Upadhyay

unread,
Feb 28, 2019, 3:27:12 AM2/28/19
to django...@googlegroups.com
yes i have at root project levelwhich has the below mentioned code:

from django.conf.urls import url, include
from django.contrib import admin
from new.views import Systemsoftware

admin.sites.AdminSite.site_header = 'SW Clearing Tool'
admin.sites.AdminSite.site_title = 'SW Clearing Tool'
admin.sites.AdminSite.index_title = 'SW Clearing Tool'
admin.sites.AdminSite.site_url = ''

urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'^new/',include('new.urls'))
]


--
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...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.

bikashsu...@gmail.com

unread,
Feb 28, 2019, 1:52:40 PM2/28/19
to Django users
umm

Tina Upadhyay

unread,
Feb 28, 2019, 9:53:33 PM2/28/19
to django...@googlegroups.com
This is working fine on my local machine but on server it is not.Can anyone suggest that what can i do to fix this??


--
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...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.

Tina Upadhyay

unread,
Mar 1, 2019, 8:25:38 AM3/1/19
to django...@googlegroups.com
Please suggest

Anh Nguyen

unread,
Mar 1, 2019, 8:55:51 AM3/1/19
to django...@googlegroups.com
Try path or re_path instead of url

Reply all
Reply to author
Forward
0 new messages