Environment:
Request Method: GETRequest URL: http://*****:8080/viewLit/edit/circuit/STTK-100G-18040-01-WRBB/
Django Version: 2.2.4Python Version: 3.6.8Installed Applications:['editLit.apps.EditlitConfig', 'viewLit.apps.ViewlitConfig', 'searchLit.apps.SearchlitConfig', 'homepage.apps.HomepageConfig', 'base.apps.BaseConfig', 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles']Installed Middleware:['django.middleware.security.SecurityMiddleware', '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 "/home/db_user/ciopsdb/venv/lib64/python3.6/site-packages/django/core/handlers/exception.py" in inner 34. response = get_response(request)
File "/home/db_user/ciopsdb/venv/lib64/python3.6/site-packages/django/core/handlers/base.py" in _get_response 115. response = self.process_exception_by_middleware(e, request)
File "/home/db_user/ciopsdb/venv/lib64/python3.6/site-packages/django/core/handlers/base.py" in _get_response 113. response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/home/db_user/ciopsdb/viewLit/views.py" in viewLit 14. record = Circuitinfotable.objects.get(circuitid=circuitid)
File "/home/db_user/ciopsdb/venv/lib64/python3.6/site-packages/django/db/models/manager.py" in manager_method 82. return getattr(self.get_queryset(), name)(*args, **kwargs)
File "/home/db_user/ciopsdb/venv/lib64/python3.6/site-packages/django/db/models/query.py" in get 408. self.model._meta.object_name
Exception Type: DoesNotExist at /viewLit/edit/circuit/STTK-100G-18040-01-WRBB/Exception Value: Circuitinfotable matching query does not exist.
<a href="/viewLit/edit/circuit/{{record.circuitid}}/" target="blank" class="edit-item" title="Edit">Edit Circuit Info</a><br>
from django.urls import path, includefrom django.conf.urls import urlfrom . import views
urlpatterns= [ path('circuit/<str:circuitid>/edit', views.editLit.as_view(),name='editLit'),]
from django.views.generic.edit import UpdateView
from . models import Circuitinfotable
# Create your views here.class editLit(UpdateView): model=Circuitinfotable template="/editLit/editCircuit.html" fields = '__all__'
{% block content %}
<form action="" method="POST">{% csrf_token %}{{form.as_p}}
<input type="submit" value="Update">
</form>
{% endblock %}
class Circuitinfotable(models.Model): id1 = models.IntegerField(blank=True, null=True) pid = models.CharField(max_length=255, blank=True, null=True) circuitid = models.CharField(primary_key=True, max_length=255, blank=False, null=False) bandwidth = models.CharField(max_length=255, blank=True, null=True) region = models.CharField(max_length=255, blank=True, null=True) bw = models.IntegerField(blank=True, null=True) tableaupathname = models.CharField(max_length=255, blank=True, null=True) handoffalocaddress = models.CharField(max_length=255, blank=True, null=True) handoffaloccity = models.CharField(max_length=255, blank=True, null=True) handoffalocst = models.CharField(max_length=255, blank=True, null=True) alocationaddress = models.CharField(max_length=255, blank=True, null=True) alocationcity = models.CharField(max_length=255, blank=True, null=True) alocst = models.CharField(max_length=255, blank=True, null=True) handoffzlocaddress = models.CharField(max_length=255, blank=True, null=True) carrier = models.CharField(max_length=255, blank=True, null=True) handoffzloccity = models.CharField(max_length=255, blank=True, null=True) handoffzlocst = models.CharField(max_length=255, blank=True, null=True) zlocationaddress = models.CharField(max_length=255, blank=True, null=True) zlocationcity = models.CharField(max_length=255, blank=True, null=True) zlocst = models.CharField(max_length=255, blank=True, null=True) segmentid = models.CharField(max_length=255, blank=True, null=True) segmenttype = models.CharField(max_length=255, blank=True, null=True) status = models.CharField(max_length=255, blank=True, null=True) purpose = models.CharField(max_length=255, blank=True, null=True) installdate = models.DateField(blank=True, null=True) termdate = models.DateField(blank=True, null=True) termlengthmos = models.IntegerField(blank=True, null=True) legacy = models.CharField(max_length=255, blank=True, null=True) installciopsticket = models.CharField(max_length=255, blank=True, null=True) retermciopsticket = models.CharField(max_length=255, blank=True, null=True) discociopsticket = models.CharField(max_length=255, blank=True, null=True) notes = models.CharField(max_length=255, blank=True, null=True) kma = models.CharField(max_length=255, blank=True, null=True) group = models.IntegerField(blank=True, null=True) cktidkey = models.IntegerField(blank=True, null=True) visiolink = models.CharField(max_length=255, blank=True, null=True) latestjiraticket = models.CharField(max_length=255, blank=True, null=True, unique=True) disconnectdate = models.DateField(blank=True, null=True) segmentname = models.CharField(max_length=255, blank=True, null=True) mrcnew = models.TextField(blank=True, null=True) # This field type is a guess. termyrs = models.IntegerField(blank=True, null=True) monthbudget = models.IntegerField(blank=True, null=True) monthdisco = models.IntegerField(blank=True, null=True) mrcold = models.TextField(blank=True, null=True) # This field type is a guess. kmz = models.CharField(max_length=255, blank=True, null=True)
class Meta: managed = False db_table = 'circuitinfotable'
def __str__(self): return self.circuitid
def get_absolute_url(self): return reverse('home')
STTK-100G-18040-01-WRBB
--
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 view this discussion on the web visit https://groups.google.com/d/msgid/django-users/b407aac9-aec7-4e45-b91a-9864c4be2d80%40googlegroups.com.
Could it possibly be that it is trying to match this entire value? /viewLit/edit/circuit/STTK-100G-18040-01-WRBB/ and if so what am I doing wrong in my urls and views that I am not dropping /viewLit/edit/circuit/?
--
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 view this discussion on the web visit https://groups.google.com/d/msgid/django-users/0f2a1551-27b4-42c0-b251-e17dcb264ab2%40googlegroups.com.
The Debug Toolbar is shown only if your IP address is listed in the
INTERNAL_IPS
setting. This means that for local
development, you must add '127.0.0.1'
to INTERNAL_IPS
;
you’ll need to create this setting if it doesn’t already exist in your
settings module:
INTERNAL_IPS = [ # ... '127.0.0.1', # ... ]
I installed the django-debug-toolbar but its not doing anything. I imported it added it to settings.py installed apps and middleware, added the if statement to the project level urls.py and Debug is set to True.
--
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 view this discussion on the web visit https://groups.google.com/d/msgid/django-users/bcc80c18-c3e8-4f29-844e-463014476c1e%40googlegroups.com.
--
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 view this discussion on the web visit https://groups.google.com/d/msgid/django-users/863520f7-65dc-4605-98d9-3d28ec1c6d1f%40googlegroups.com.
Query | Timeline | Time (ms) | Action | ||
---|---|---|---|---|---|
+ | SELECT ••• FROM "circuitinfotable" WHERE "circuitinfotable"."circuitid" = 'edit/circuit/STTK-100G-18040-01-WRBB' | 53.76007636826474% | 2.42 | ||
+ | SELECT ••• FROM "circuitinfotable" LIMIT 21 | 15.353203224437845% | 0.69 | ||
+ | SELECT ••• FROM "django_session" WHERE ("django_session"."expire_date" > '2019-11-26T20:52:52.260094+00:00'::timestamptz AND "django_session"."session_key" = '0b3x3t7gx8sbl09y5vsbonxtlfmynib4') | 16.928298684768777% | 0.76 | ||
+ | SELECT ••• FROM "auth_user" WHERE "auth_user"."id" = 1 |
<a href="/viewLit/edit/circuit/{{record.circuitid}}/" target="blank" class="edit-item" title="Edit">Edit Circuit Info</a><br>
--
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 view this discussion on the web visit https://groups.google.com/d/msgid/django-users/fbd433a9-bf5d-4ee4-b51c-51efbe110a57%40googlegroups.com.
<a href="/viewLit/edit/jira/{{record.circuitid}}" class="edit-item" target="blank" title="Edit">Edit Jira Info</a><br>
from django.contrib import admin
from django.urls import path, includefrom django.conf.urls import url
import debug_toolbar
urlpatterns = [ path('admin/', admin.site.urls), path('', include('homepage.urls')), path('searchlit/', include('searchLit.urls')), path('viewLit/edit/', include('editLit.urls')), path('viewLit/', include('viewLit.urls')), path('edit/', include('editLit.urls')), path(r'^__debug__/', include(debug_toolbar.urls)),]
from django.urls import path, includefrom django.conf.urls import urlfrom . import views
urlpatterns= [
path('edit/circuit/<str:circuitid>', views.editLit.as_view(),name='editLit'),]
class editLit(UpdateView): pk_url_kwarg = 'circuitid'
model=Circuitinfotable template="/editLit/editCircuit.html" fields = '__all__'
urlpatterns= [ path('jira/<str:circuitid>', views.editLit.as_view(),name='editLit'),]
--
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 view this discussion on the web visit https://groups.google.com/d/msgid/django-users/9685efa1-b9b1-46e2-b831-d6144e0ebdf2%40googlegroups.com.
<a href="/viewLit/edit/jira/{{record.circuitid}}" class="edit-item" target="blank" title="Edit">Edit Jira Info</a><br>
from django.contrib import adminfrom django.urls import path, includefrom django.conf.urls import urlimport debug_toolbar
urlpatterns = [ path('admin/', admin.site.urls), path('', include('homepage.urls')), path('searchlit/', include('searchLit.urls')), path('viewLit/edit/', include('editLit.urls')), path('viewLit/', include('viewLit.urls')), path('edit/', include('editLit.urls')), path(r'^__debug__/', include(debug_toolbar.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 view this discussion on the web visit https://groups.google.com/d/msgid/django-users/53dd1d57-4465-4af3-9b9e-183a2f9b6913%40googlegroups.com.
<a href="/viewLit/edit/circuit/{{record.circuitid}}/" target="blank" class="edit-item" title="Edit">Edit Circuit Info</a><br>
from django.contrib import adminfrom django.urls import path, includefrom django.conf.urls import urlimport debug_toolbar
urlpatterns = [ path('admin/', admin.site.urls), path('', include('homepage.urls')), path('searchlit/', include('searchLit.urls')), path('viewLit/edit/', include('editLit.urls')), path('viewLit/', include('viewLit.urls')), path('edit/', include('editLit.urls')), path(r'^__debug__/', include(debug_toolbar.urls)),]
So, editLit.urls will be:
[...]urlpatterns = [ [...]
path('circuit/<str:circuitid>', views.editLit.as_view(),name='editLit'),
[....]
]
But it doesn't work it gives me the same error:
--
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 view this discussion on the web visit https://groups.google.com/d/msgid/django-users/a4e4c292-11cb-443f-8a2a-bcb91053f6f1%40googlegroups.com.
SELECT ••• FROM "circuitinfotable" WHERE "circuitinfotable"."circuitid" = 'STTK-100G-18040-01-WRBB'
Environment:
Request Method: GET
Django Version: 2.2.4Python Version: 3.6.8Installed Applications:['editLit.apps.EditlitConfig', 'viewLit.apps.ViewlitConfig', 'searchLit.apps.SearchlitConfig', 'homepage.apps.HomepageConfig', 'base.apps.BaseConfig', 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages',
'django.contrib.staticfiles', 'debug_toolbar']
Installed Middleware:['django.middleware.security.SecurityMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware',
'debug_toolbar.middleware.DebugToolbarMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware']
Template loader postmortemDjango tried loading these templates, in this order:
Using engine django: * django.template.loaders.filesystem.Loader: /home/db_user/ciopsdb/base/templates/viewLit/circuitinfotable_form.html (Source does not exist) * django.template.loaders.filesystem.Loader: /home/db_user/ciopsdb/templates/viewLit/circuitinfotable_form.html (Source does not exist) * django.template.loaders.app_directories.Loader: /home/db_user/ciopsdb/editLit/templates/viewLit/circuitinfotable_form.html (Source does not exist) * django.template.loaders.app_directories.Loader: /home/db_user/ciopsdb/viewLit/templates/viewLit/circuitinfotable_form.html (Source does not exist) * django.template.loaders.app_directories.Loader: /home/db_user/ciopsdb/searchLit/templates/viewLit/circuitinfotable_form.html (Source does not exist) * django.template.loaders.app_directories.Loader: /home/db_user/ciopsdb/homepage/templates/viewLit/circuitinfotable_form.html (Source does not exist) * django.template.loaders.app_directories.Loader: /home/db_user/ciopsdb/base/templates/viewLit/circuitinfotable_form.html (Source does not exist) * django.template.loaders.app_directories.Loader: /home/db_user/ciopsdb/venv/lib64/python3.6/site-packages/django/contrib/admin/templates/viewLit/circuitinfotable_form.html (Source does not exist) * django.template.loaders.app_directories.Loader: /home/db_user/ciopsdb/venv/lib64/python3.6/site-packages/django/contrib/auth/templates/viewLit/circuitinfotable_form.html (Source does not exist) * django.template.loaders.app_directories.Loader: /home/db_user/ciopsdb/venv/lib64/python3.6/site-packages/debug_toolbar/templates/viewLit/circuitinfotable_form.html (Source does not exist)
Traceback:
File "/home/db_user/ciopsdb/venv/lib64/python3.6/site-packages/django/core/handlers/exception.py" in inner 34. response = get_response(request)
File "/home/db_user/ciopsdb/venv/lib64/python3.6/site-packages/django/core/handlers/base.py" in _get_response
145. response = self.process_exception_by_middleware(e, request)
File "/home/db_user/ciopsdb/venv/lib64/python3.6/site-packages/django/core/handlers/base.py" in _get_response 143. response = response.render()
File "/home/db_user/ciopsdb/venv/lib64/python3.6/site-packages/django/template/response.py" in render 106. self.content = self.rendered_content
File "/home/db_user/ciopsdb/venv/lib64/python3.6/site-packages/django/template/response.py" in rendered_content 81. template = self.resolve_template(self.template_name)
File "/home/db_user/ciopsdb/venv/lib64/python3.6/site-packages/django/template/response.py" in resolve_template 63. return select_template(template, using=self.using)
File "/home/db_user/ciopsdb/venv/lib64/python3.6/site-packages/django/template/loader.py" in select_template 47. raise TemplateDoesNotExist(', '.join(template_name_list), chain=chain)
Exception Type: TemplateDoesNotExist at /viewLit/STTK-100G-18040-01-WRBB/editException Value: viewLit/circuitinfotable_form.html
class Circuitinfotable(models.Model): id1 = models.IntegerField(blank=True,null=True)
pid = models.CharField(max_length=255, blank=True, null=True)
circuitid = models.CharField(primary_key=True, max_length=255, blank=True, null=False)
def get_absolute_url(self): return reverse()
import refrom django.shortcuts import renderfrom django.http import HttpResponsefrom django.views.generic import TemplateViewfrom django.views.generic.edit import UpdateViewfrom django.urls import reverse
from . models import Circuitinfotable, Budgettable, Xcinventorytable
# Create your views here.
def viewLit(request, circuitid): ruleList=["/SB", "/ZYO", "/ZYO /", "/MS", "/CLVI", "ELG"] for rule in ruleList: if(len(re.findall(rule + "$", circuitid))>0): circuitid=re.sub(rule+"$","/"+rule, circuitid) record = Circuitinfotable.objects.get(circuitid=circuitid) template = 'viewLit/viewCircuit.html' context = {'record':record} return render(request, template, context)
class editLit(UpdateView): pk_url_kwarg = 'circuitid' model=Circuitinfotable
from django.urls import path, includefrom django.conf.urls import url
from . import views
urlpatterns= [
path('<path:circuitid>/', views.viewLit, name='viewLit'), path('<path:circuitid>/edit', views.editLit.as_view(), name='editLit'),]
<html text/html>
<body>
{% block content %}
<form action="" method="POST">{% csrf_token %}{{form.as_p}}
<input type="submit" value="Update">
</form>
{% endblock %}
</body></html>
--
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 view this discussion on the web visit https://groups.google.com/d/msgid/django-users/c300fd7c-1f8e-4efe-89d3-2eaa175e2100%40googlegroups.com.
from django.forms import ModelForm
from . models import Circuitinfotable
class CircuitinfotableForm(ModelForm): class Meta: model = Circuitinfotable fields = '__all__'
class editLit(UpdateView): pk_url_kwarg = 'circuitid' model=Circuitinfotable
form_class= CircuitinfotableForm template="/viewLit/editCircuit.html"# fields='__all__'
'circuitinfotable_form.html'
on
one of your folders :
/home/db_user/ciopsdb/base/templates/viewLit/circuitinfotable_form.html
/home/db_user/ciopsdb/templates/viewLit/circuitinfotable_form.html
/home/db_user/ciopsdb/editLit/templates/viewLit/circuitinfotable_form.html
/home/db_user/ciopsdb/viewLit/templates/viewLit/circuitinfotable_form.html
/home/db_user/ciopsdb/searchLit/templates/viewLit/circuitinfotable_form.html
/home/db_user/ciopsdb/homepage/templates/viewLit/circuitinfotable_form.html
<html text/html>
<body>{% block content %}
<form action="" method="POST">{% csrf_token %}{{form.as_p}}
<input type="submit" value="Update">
</form>
{% endblock %}</body></html>