>>> How can i create 2 views on one page?
>>> def sql(request): and def portal(request):
You can't. A View *is* a page. Do the tutorial.
You could use class-based views and have a view that inherits from
both, and combines the contexts (this is _not_ in the tuto)
--
"The whole of Japan is pure i
>
> How can i create 2 views on one page?
>> def sql(request): and def portal(request):
>>
>
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/django-users/-/xneUlf_fSGA
Hmm ok, i can use
return render_to_response("sql.html", { 'row': row })
and when i call now http://127.0.0.1:8000/sql/, i can see the correct data.
But i will call http://127.0.0.1:8000/portal/ and try to implements the sql
code in this page.
I have by base.html in addition now " {% incl
Ok, when i use now http://127.0.0.1:8000/sql/, the output is
Kundendaten [('bla Hansruedi (THA) ', 'hansruedi@blubb.ch ')].
i have in base.html now " {% include "sql.html" %}" in addition.
when i use now http://127.0.0.1:8000/portal/, my output is just:
Kundendaten .
how can i fix this pro
>
> Thank you for this page. I take my time today, to learn on it. :)
>
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/django-users/-/a9kvWj-zSjAJ.
To post to this group
>> Thank you for your answer. i have chapter 1-4 of
>> http://www.djangobook.com/en/2.0/index.html done, but not much time to go
>> throught the hole book atm. i will try it with your code. :)
the django book is somewhat outdated, and long.
https://docs.djangoproject.com/en/dev/intro/tutorial01/
>
> Thank you for your answer. i have chapter 1-4 of
> http://www.djangobook.com/en/2.0/index.html done, but not much time to go
> throught the hole book atm. i will try it with your code. :)
>
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
>
> how can i implements now these "def sql(request):" into my html code? pls
> help me...
>
you're saying next to nothing, but I *guess* you could do something like
return render_to_response("sql.html", { 'row': row })
at the bottom of your sql view, and write an sql.html template that
shows it
>
> I forgot, sql is now hardcodet and i have to change it. on first page i
> have to give the filter and the username...
>
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To view this discussion on the web visit
https://groups.google.com/d/m
Hi all
i have there a little problem and my knowhow with django is not existent. ^^
What i have...
--- urls.py -
from django.conf.urls import patterns, include, url
from klasse.views import portal, sql
urlpatterns = patterns('',
(r'^portal/$', portal),
(r'^sql/$', sql)
10 matches
Mail list logo