rspivak / lsbaws

Let's Build A Web Server
MIT License
658 stars 303 forks source link

i got some import error with python2 #14

Open fooSynaptic opened 5 years ago

fooSynaptic commented 5 years ago

can you help me debug webapp with django

ile "/usr/local/Cellar/python@2/2.7.15_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/importlib/__init__.py" in import_module
  37.     __import__(name)

File "/Users/ajmd/code/webserver/helloworld/urls.py" in <module>
  1. from django.conf.urls import patterns, include, url

Exception Type: ImportError at /hello
Exception Value: cannot import name patterns

and the source code:

from django.conf.urls import patterns, include, url
from django.contrib import admin

urlpatterns = patterns(
    '',
    # Examples:
    # url(r'^$', 'helloworld.views.home', name='home'),
    # url(r'^blog/', include('blog.urls')),

    url(r'^admin/', include(admin.site.urls)),

    (r'^hello', 'helloworld.views.index'),

)
fooSynaptic commented 5 years ago

i thought this might because the env issue, but i have no idea how to fix it