--
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 http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/031cb075-cdd8-47bf-9a6f-6135209deeb7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
and yes vmware is defined in installed apps.
so in my project.urls file i put
I'm running 1.6.4
/djangoprojects/provisioning/provisioning/urls.py<code>
from django.conf.urls import patterns, include, url
from django.contrib import adminadmin.autodiscover()
from . import vmwareurlpatterns = patterns('',# Examples:
# url(r'^$', 'provisioning.views.home', name='home$
# url(r'^blog/', include('blog.urls')),
url(r'^admin/', include(admin.site.urls)),url(r'^customers/', include(vmware.urls)),
)</code>/djangoprojects/provisioning/vmware/urls.py<code>
from django.conf.urls import patterns, include, urlfrom django.view.generic import ListViewfrom vmware.models import Customerurlpatterns = patterns('',
url(r'^customers/', ListView.as_$queryset=Customer.obje$template_name="VMS.htm$)</code>
INSTALLED_APPS = (
'django.contrib.admin','django.contrib.auth','django.contrib.contenttypes','django.contrib.sessions','django.contrib.messages','django.contrib.staticfiles',
'vmware',)</code>Directory Structuredirectory structure provisioning is the project vmware is the app.drwxr-xr-x 4 root root 4096 May 5 20:12 .drwxr-xr-x 3 root root 4096 May 5 19:09 ..-rw-r--r-- 1 root root 255 May 5 19:09 manage.pydrwxr-xr-x 2 root root 4096 May 6 11:15 provisioningdrwxr-xr-x 3 root root 4096 May 6 11:15 vmware/djangoprojects/provisioning/vmware/modesl.py
from django.db import models# Create your models here.class Customer(models.Model):NAME = models.CharField(max_length=200)WEBSITE = models.CharField(max_length=200)PHONE = models.CharField(max_length=200)EMAIL = models.CharField(max_length=200)ADDRESS = models.CharField(max_length=200)VMIDS = models.CharField(max_length=200)def __unicode__(self):return self.NAME# return self.NAMEclass Vms(models.Model):VMID = models.CharField(max_length=200)VMNAME = models.CharField(max_length=200)VMSTATUS = models.CharField(max_length=200)CUSTOMERID = models.ForeignKey(Customer)class Vmspecs(models.Model):CPUS = models.CharField(max_length=200)CORES = models.CharField(max_length=200)MEMORY = models.CharField(max_length=200)HDSPACE = models.CharField(max_length=200)OS = models.CharField(max_length=200)UPTIME = models.CharField(max_length=200)VMID = models.ForeignKey(Vms)# choice_text = models.CharField(max_length=200)</code>
django-twoscoops-project / project_name / project_name /
in fact here is the tutorial series I was following
Whats wrong with this
Thanks so much one last thing
Request Method: | GET |
---|---|
Request URL: | http://pythondev.enki.co:8001/customers |
Using the URLconf defined in provisioning.urls
, Django tried these URL patterns, in this order:
The current URL, customers
, didn't match any of these.
DEBUG = True
in your Django settings file. Change that to False
, and Django will display a standard 404 page.--
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 http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/46bc38b8-a024-407f-8f6a-db3c62255afa%40googlegroups.com.
The admin page works fine only the other two don't
Project Structure Project Root Directory: provisioning/ this is where manage.py lives
Project Settings Directory provisioning/provisioning/settings.py
App Directory provisioning/vmware
template directory /provisioning/vmware/templates/ this is wehre vms.html lives
from my project urls.py file
GNU nano 2.2.6 File: provisioning/urls.py
from django.conf.urls import patterns, include, url
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
# url(r'^$', 'provisioning.views.home', name='home'),
url(r'^admin/', include(admin.site.urls)),
url(r'^customers', include('vmware.urls')),
url(r'^test/', include('vmware.urls')),
)
from my app urls.py file:
from django.conf.urls import patterns, include, url
from django.views.generic.list 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")),
)
urlpatterns = patterns('',
url(r'^test/', ListView.as_view(
queryset=Customer.objects.all().order_by("-id")[:100],
template_name="vms.html")),
)
and then this is the error im getting
Page not found (404)
Request Method: GET
Request URL: http://pythondev.enki.co:8001/test
Using the URLconf defined in provisioning.urls, Django tried these URL patterns, in this order:
^admin/
^customers
^test/
The current URL, test, didn't match any of these.
You're seeing this error because you have DEBUG = True in your Django settings file. Change that to False, and Django will display a standard 404 page.
--
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 http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/fcba60dc-4bc2-4ca4-9e44-e4bc9fd7a5d4%40googlegroups.com.