python - Django - urls.py in project, and url.py in app -


I'm trying to redirect the form action to another page, however, I'm not familiar with the Django framework Am I went through the election tutorial

The current urls.py: django.conf.urls import pattern in my project includes, include, django.contrib Import Admin from WebApp Import View URL StripCal import ideas from admin.autodiscover () Urlpatterns = Pattern (', URL (r' ^ admin / ', (admin.site.urls)), are included in the URL (r' ^ webapp / 'included (' WebApp.urls', namespace = "WebApp") ), URL (r '^ stripcal /' is included ('StripCal.urls', name space = "StripCal")),) my url.py is in stripcal application: from django.conf. URL import patterns include, StripCal import ideas urlpatterns = patterns from django.contrib import admin ('URL' ('r' ^ ', views.index, name =' url from index '), url (r' ^ run ' , Views.detail, name = 'detail'),)

when I type

  http://127.0.0.1:8000/stripcal /http://127.0.0.1:8000/webapp/  

This successfully navigates to two different applications, however, I use {% url 'app_name: view_name'%} syntax Not very familiar. It seems like 'app_name: VIEW_NAME' is / app_name / VIEW_NAME

This is my current view:

  get_object_or_404 import from django.shortcuts, django Render django.core.urlresolvers from httpResponseRedirect import .django.views import generic # create your ideas here Defindex (request): reference = {'somethingDownByCelery': "hey"} Return submission (request, ' Definition = {'somethingDownByCelery': "hey"} Return    
  {% load staticfiles%} & Lt; "Stylesheet" type = "Text / CSS" href = "{% Static 'Stripclick / Index' {% Csrf_token%} & lt; p & gt; Stripical input & quot; CSS & quot; form action = "{% url}"; {% url} Lt; / p & gt; textarea name = "StripCal_Input" cols = "30" rows = "10" & gt; & lt; / text field & gt; & lt; br & gt; & lt; br & Gt; & lt; input type = "submit" value = "submit" & gt; & lt; / form & gt;  

my detail.html

  {% load staticfi Les%} & lt; link rel = "stylesheet" type = "text / css" href = "{% static" stripcale / description "%}" /> Hello extension!  

When I delete it, the page also does not load (HTP500). / P>

try to change : StripCal.url.py

  urlpatterns = Pattern ('stripcode statement', url (r '^ $', 'index', name = 'index'), url (r 'run ',' Expansion ', name =' extension '),  / pre> 

)


Comments

Popular posts from this blog

sqlite3 - UPDATE a table from the SELECT of another one -

c# - Showing a SelectedItem's Property -

javascript - Render HTML after each iteration in loop -