Sorry, it's been a while since I looked at the tutorial, to make the tutorial more straightforward it uses a simplified project layout. I looked at your urls again, and the error is that you forgot quotes. url(r'^customers/', include(vmware.urls)), should be url(r'^customers/', include('vmware.urls')),
and you should remove the from . import vmware Kirby On Tuesday, May 6, 2014 1:05:30 PM UTC-5, G Z wrote: > > I'm following the django tutorial > > the project is provisioning > I created the folder provisioning folder, then ran startproject > provisioning which has manage.py then it creates the subfolder provisioning > which has the init.py file and settings etc. > then from the root directory of my project folder the first level or > provisioning where manage.py is i used startapp command and it created > vmware so from the root directory of the project provisioning it created > provisioning for the project and it created vmware. That is following the > tutorial on djangoproject.com > > so how did I do it wrong? > > On Monday, May 5, 2014 11:09:51 PM UTC-6, G Z wrote: >> >> project name = provisioning >> app name = vmware >> >> In my projects urls.py I have the following. I assume I set the new url >> link customers to myapp.urls because im watching a youtube video and thats >> what he did. >> >> from django.conf.urls import patterns, include, url >> from django.contrib import admin >> admin.autodiscover() >> urlpatterns = patterns('', >> url(r'^admin/', include(admin.site.urls)), >> url(r'^customers/', include(vmware.urls)), #i'm assuming its my >> appsname.urls >> ) >> >> In my vmware directory I have the urls.py file as the video had me >> design. To which I have the following code: >> >> from django.conf.urls import patterns, include, url >> from django.view.generic import ListView >> from vmware.models import Customer >> >> urlpatterns = patterns('', >> url(r'^customers/', ListView.as_view( >> >> queryset=Customer.objects.all().order_by"-id")[:100], >> template_name="VMS.html")), >> ) >> >> Now when I syncdb and runserver I get no erros. But when I try to resolve >> the page I get the following. It says vmware is not defined but it is >> defined in my installed apps. >> >> Environment: >> >> >> Request Method: GET >> Request URL: http://23.239.206.142:8001/admin/ >> >> Django Version: 1.6.4 >> Python Version: 2.7.3 >> Installed Applications: >> ('django.contrib.admin', >> 'django.contrib.auth', >> 'django.contrib.contenttypes', >> 'django.contrib.sessions', >> 'django.contrib.messages', >> 'django.contrib.staticfiles', >> 'vmware') >> Installed Middleware: >> ('django.contrib.sessions.middleware.SessionMiddleware', >> 'django.middleware.common.CommonMiddleware', >> 'django.middleware.csrf.CsrfViewMiddleware', >> 'django.contrib.auth.middleware.AuthenticationMiddleware', >> 'django.contrib.messages.middleware.MessageMiddleware', >> 'django.middleware.clickjacking.XFrameOptionsMiddleware') >> >> >> Traceback: >> File >> "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py" in >> get_response >> 101. resolver_match = >> resolver.resolve(request.path_info) >> File "/usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py" >> in resolve >> 337. for pattern in self.url_patterns: >> File "/usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py" >> in url_patterns >> 365. patterns = getattr(self.urlconf_module, "urlpatterns", >> self.urlconf_module) >> File "/usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py" >> in urlconf_module >> 360. self._urlconf_module = import_module(self.urlconf_name) >> File "/usr/local/lib/python2.7/dist-packages/django/utils/importlib.py" >> in import_module >> 40. __import__(name) >> File "/root/djangoprojects/provisioning/provisioning/urls.py" in <module> >> 12. url(r'^customers/', include(vmware.urls)), >> >> Exception Type: NameError at /admin/ >> Exception Value: name 'vmware' is not defined >> >> -- 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+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at http://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/e0a012f6-d55f-45bf-8ab6-82c4583550ad%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.