milu-buet / django-bKash

bKash_payment is a simple Django app to conduct Web-based bKash payment.
Other
8 stars 5 forks source link

ImportError: cannot import name patterns #1

Open nabirhossain opened 5 years ago

nabirhossain commented 5 years ago

I integrate bKash payment system in my django-oscar project. But I get this error

    '(oscar_env) deadpoll@deadpoll-3420:~/oscar_env/xeroshop$ pip install django-bKhsh
    (oscar_env) deadpoll@deadpoll-3420:~/oscar_env/xeroshop$ python manage.py migrate
    Traceback (most recent call last):
    File "manage.py", line 22, in <module>
     execute_from_command_line(sys.argv)
     File "/home/deadpoll/oscar_env/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 364, in execute_from_command_line
utility.execute()
     File "/home/deadpoll/oscar_env/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 356, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
    File "/home/deadpoll/oscar_env/local/lib/python2.7/site-packages/django/core/management/base.py", line 283, in run_from_argv
self.execute(*args, **cmd_options)
    File "/home/deadpoll/oscar_env/local/lib/python2.7/site-packages/django/core/management/base.py", line 327, in execute
self.check()
    File "/home/deadpoll/oscar_env/local/lib/python2.7/site-packages/django/core/management/base.py", line 359, in check
include_deployment_checks=include_deployment_checks,
    File "/home/deadpoll/oscar_env/local/lib/python2.7/site-packages/django/core/management/commands/migrate.py", line 62, in _run_checks
issues.extend(super(Command, self)._run_checks(**kwargs))
    File "/home/deadpoll/oscar_env/local/lib/python2.7/site-packages/django/core/management/base.py", line 346, in _run_checks
return checks.run_checks(**kwargs)
   File "/home/deadpoll/oscar_env/local/lib/python2.7/site-packages/django/core/checks/registry.py", line 81, in run_checks
new_errors = check(app_configs=app_configs)
  File "/home/deadpoll/oscar_env/local/lib/python2.7/site-packages/django/core/checks/urls.py", line 16, in check_url_config
return check_resolver(resolver)
  File "/home/deadpoll/oscar_env/local/lib/python2.7/site-packages/django/core/checks/urls.py", line 26, in check_resolver
return check_method()
   File "/home/deadpoll/oscar_env/local/lib/python2.7/site-packages/django/urls/resolvers.py", line 256, in check
for pattern in self.url_patterns:
   File "/home/deadpoll/oscar_env/local/lib/python2.7/site-packages/django/utils/functional.py", line 35, in __get__
res = instance.__dict__[self.name] = self.func(instance)
    File "/home/deadpoll/oscar_env/local/lib/python2.7/site-packages/django/urls/resolvers.py", line 407, in url_patterns
patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
    File "/home/deadpoll/oscar_env/local/lib/python2.7/site-packages/django/utils/functional.py", line 35, in __get__
res = instance.__dict__[self.name] = self.func(instance)
    File "/home/deadpoll/oscar_env/local/lib/python2.7/site-packages/django/urls/resolvers.py", line 400, in urlconf_module
return import_module(self.urlconf_name)
    File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
__import__(name)
   File "/home/deadpoll/oscar_env/xeroshop/xeroshop/urls.py", line 26, in <module>
url(r'^bKash_payment/', include('bKash_payment.urls')),
    File "/home/deadpoll/oscar_env/local/lib/python2.7/site-packages/django/conf/urls/__init__.py", line 50, in include
urlconf_module = import_module(urlconf_module)
    File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
__import__(name)
    File "/home/deadpoll/oscar_env/local/lib/python2.7/site-packages/bKash_payment/urls.py", line 1, in <module>
     from rest_framework.urlpatterns import format_suffix_patterns
     ImportError: No module named rest_framework.urlpatterns'

when I push migrate then I get this error. so, I install django rest framework, then i solve this error. But when I push migrate again, then I get this error.

   (oscar_env) deadpoll@deadpoll-3420:~/oscar_env/xeroshop$ pip install djangorestframework
   Collecting djangorestframework
   (oscar_env) deadpoll@deadpoll-3420:~/oscar_env/xeroshop$ python manage.py migrate
   Traceback (most recent call last):
   File "manage.py", line 22, in <module>
    execute_from_command_line(sys.argv)
   File "/home/deadpoll/oscar_env/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 364, in execute_from_command_line
utility.execute()
    File "/home/deadpoll/oscar_env/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 356, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
   File "/home/deadpoll/oscar_env/local/lib/python2.7/site-packages/django/core/management/base.py", line 283, in run_from_argv
self.execute(*args, **cmd_options)
   File "/home/deadpoll/oscar_env/local/lib/python2.7/site-packages/django/core/management/base.py", line 327, in execute
self.check()
   File "/home/deadpoll/oscar_env/local/lib/python2.7/site-packages/django/core/management/base.py", line 359, in check
include_deployment_checks=include_deployment_checks,
   File "/home/deadpoll/oscar_env/local/lib/python2.7/site-packages/django/core/management/commands/migrate.py", line 62, in _run_checks
issues.extend(super(Command, self)._run_checks(**kwargs))
   File "/home/deadpoll/oscar_env/local/lib/python2.7/site-packages/django/core/management/base.py", line 346, in _run_checks
return checks.run_checks(**kwargs)
  File "/home/deadpoll/oscar_env/local/lib/python2.7/site-packages/django/core/checks/registry.py", line 81, in run_checks
new_errors = check(app_configs=app_configs)
  File "/home/deadpoll/oscar_env/local/lib/python2.7/site-packages/django/core/checks/urls.py", line 16, in check_url_config
return check_resolver(resolver)
  File "/home/deadpoll/oscar_env/local/lib/python2.7/site-packages/django/core/checks/urls.py", line 26, in check_resolver
return check_method()
   File "/home/deadpoll/oscar_env/local/lib/python2.7/site-packages/django/urls/resolvers.py", line 256, in check
for pattern in self.url_patterns:
   File "/home/deadpoll/oscar_env/local/lib/python2.7/site-packages/django/utils/functional.py", line 35, in __get__
res = instance.__dict__[self.name] = self.func(instance)
   File "/home/deadpoll/oscar_env/local/lib/python2.7/site-packages/django/urls/resolvers.py", line 407, in url_patterns
patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
  File "/home/deadpoll/oscar_env/local/lib/python2.7/site-packages/django/utils/functional.py", line 35, in __get__
res = instance.__dict__[self.name] = self.func(instance)
  File "/home/deadpoll/oscar_env/local/lib/python2.7/site-packages/django/urls/resolvers.py", line 400, in urlconf_module
return import_module(self.urlconf_name)
  File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
__import__(name)
  File "/home/deadpoll/oscar_env/xeroshop/xeroshop/urls.py", line 26, in <module>
url(r'^bKash_payment/', include('bKash_payment.urls')),
  File "/home/deadpoll/oscar_env/local/lib/python2.7/site-packages/django/conf/urls/__init__.py", line 50, in include
urlconf_module = import_module(urlconf_module)
   File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
__import__(name)
   File "/home/deadpoll/oscar_env/local/lib/python2.7/site-packages/bKash_payment/urls.py", line 5, in <module>
  from django.conf.urls import patterns
  ImportError: cannot import name patterns'

How can I solve it?

milu-buet commented 5 years ago

The reason is ,patterns has been removed since Django 1.8. Django-bKash is outdated for the current django. Click here.

BTW, this app is a dummy app. It has no wisdom to offer. I am sorry that it wasted your time.

nabirhossain commented 5 years ago

Please update your App than release a new version.

On Sat, 1 Sep 2018, 11:43 pm Lutfar Rahman Milu, notifications@github.com wrote:

The reason is ,patterns has been removed since Django 1.8. Django-bKash is outdated for the current django. Click here https://stackoverflow.com/questions/8074955/cannot-import-name-patterns.

BTW, this app is a dummy app. It has no wisdom to offer. I am sorry that it wasted your time.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/milu-buet/django-bKash/issues/1#issuecomment-417875855, or mute the thread https://github.com/notifications/unsubscribe-auth/AOXNzd-u0Uib1wcCL1kuinbQIaDY72Jrks5uWsdDgaJpZM4WWKqW .

emoncse commented 3 years ago

Please update your app.

milu-buet commented 3 years ago

I'm no longer working on it. It is outdated.