Re: Is Django right for what I am trying to do

2010-07-21 Thread SteveB.
Hi Bradley,

Just my 2c re feeling comfortable with how django does things:-

A high level walkthrough of which bits of Django are used and how they
fit together.

1. You define the URL's that you want to present via a web server in
urls.py.
2. In the urls.py file you configure url's and map these to views
(python functions) held in views.py
3. The views can take an HTTP request as a parameter along with the
parameters from the context.
4. The views use the parameters to retrieve a model instance, or
multiple model instances.
5. The view 'calls' a template with the model instances received by 4.
6. The template processor parses the template & processes the model
instances.
7. The view returns the processed template to the browser, or can
redirects to another URL.

8. If you want a quick CRUD set of forms for admin use only you can
use the admin functionality to provide this - you don't have to
though.

I think it takes a bit of getting your head around initially but it's
very flexible/powerful when you do.  There are loads of other things
that Django can do, including Form processing but you can code forms
yourself if you prefer.

HIH

On Jul 8, 6:43 pm, Bradley Hintze  wrote:
> Hi all
>
> I did the tutorial and I've spent the last two days in the
> documentation trying, and failing, to figure out how to tie my model
> to a view and ultimately a template that is served. The documentation
> seems to do a lot of things (like write html) automatically which is
> not what I want (seehttp://docs.djangoproject.com/en/dev/topics/forms/).  I 
> am not
> interested in admin sites, they make things easier but I am interested
> in learning the code (i.e. the HTML and how it communicates with
> python) rather than, in my view, just blackbox automation.
>
> I hope this makes sense. Please tell me if it doesn't.  I want to
> simply upload a file and then process the file using code I already
> have. I would like to write the HTML code myself rather then having
> django automatically do it. This is because I want to learn how to
> process forms and not have a black box do everything for me. Are there
> methods to simply get post data from a form that I write rather the
> django automatically creating it (an example maybe)? are models
> necessary for what I'm explaining? Is django right for what I'm
> explaining?
>
> --
> Bradley J. Hintze
> Graduate Student
> Duke University
> School of Medicine
> 801-712-8799

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Is Django right for what I am trying to do

2010-07-20 Thread drygal
I think I was in a similar position not so long ago. It all makes more
sense if you get familiar with all functionalities used by or similar
to those used by Django. I have played with other template frameworks,
sqlalchemy and mod_wsgi, I was aslo writing own classes for handling
forms etc. separately for a while and then came back to Django.
Without that experience it is difficult to tie what Django does in the
background with python knowledge.

I hope it helps.


On 8 July, 18:43, Bradley Hintze  wrote:
> Hi all
>
> I did the tutorial and I've spent the last two days in the
> documentation trying, and failing, to figure out how to tie my model
> to a view and ultimately a template that is served. The documentation
> seems to do a lot of things (like write html) automatically which is
> not what I want (seehttp://docs.djangoproject.com/en/dev/topics/forms/).  I 
> am not
> interested in admin sites, they make things easier but I am interested
> in learning the code (i.e. the HTML and how it communicates with
> python) rather than, in my view, just blackbox automation.
>
> I hope this makes sense. Please tell me if it doesn't.  I want to
> simply upload a file and then process the file using code I already
> have. I would like to write the HTML code myself rather then having
> django automatically do it. This is because I want to learn how to
> process forms and not have a black box do everything for me. Are there
> methods to simply get post data from a form that I write rather the
> django automatically creating it (an example maybe)? are models
> necessary for what I'm explaining? Is django right for what I'm
> explaining?
>
> --
> Bradley J. Hintze
> Graduate Student
> Duke University
> School of Medicine
> 801-712-8799

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Is Django right for what I am trying to do

2010-07-20 Thread derek
On Jul 19, 1:19 am, Martin Tiršel  wrote:
> On Fri, 09 Jul 2010 16:50:14 +0200, derek  wrote:
> > More complex or more detailed?  (I would argue that The Django Book is
> > about as high quality as you are ever going to get for a free
> > tutorial)
>
> > Try:http://www.hoboes.com/NetLife/pytown/django-beyond-sql/
>
> > or:  
> >http://opensourcebridge.org/2009/wiki/Django%3A_Thinking_Outside_The_...
>
> > or:http://www.slideshare.net/jacobian/django-in-the-real-world-175
>
> Thanks for links, as I have some time, I will go through :)
>
> I would appreciated if there are some tutorials how to use some advanced  
> things in real web applications and not how to display first 10 blog  
> entries and so on :)
>
> > The real issue is that, because Django is a framework, designed to
> > meet N number of possible needs, once you get "beyond the basics", the
> > specifics start to diverge more and more from what _you_ actually need
> > to do.
>
> > My 2c
> > Derek
>
> You are right.
>
Ok, you seem not to understand what I am saying, so I will try and
explain some more.

Building very complex apps is a very specific activity and that is why
there are no tutorials on "advanced  things" (as you call them,
without being specific as to what it actually is you need).  The point
is that once you understand the basics and have been through the
process to construct a "standard" website with Django - and, yes, you
*can* do that with all the resources available to you on the web - you
will find yourself able to envision and conceptualize building more
complex ones.  In that process you will ask more "advanced" questions
and get "advanced" answers that will make more sense to you *because*
you now understand the fundamentals.  I don't believe there is a short-
cut to that learning process.

Hope this makes sense.

Derek

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Is Django right for what I am trying to do

2010-07-18 Thread Martin Tiršel

On Fri, 09 Jul 2010 16:50:14 +0200, derek  wrote:


More complex or more detailed?  (I would argue that The Django Book is
about as high quality as you are ever going to get for a free
tutorial)

Try: http://www.hoboes.com/NetLife/pytown/django-beyond-sql/

or:  
http://opensourcebridge.org/2009/wiki/Django%3A_Thinking_Outside_The_Blog


or: http://www.slideshare.net/jacobian/django-in-the-real-world-175


Thanks for links, as I have some time, I will go through :)

I would appreciated if there are some tutorials how to use some advanced  
things in real web applications and not how to display first 10 blog  
entries and so on :)




The real issue is that, because Django is a framework, designed to
meet N number of possible needs, once you get "beyond the basics", the
specifics start to diverge more and more from what _you_ actually need
to do.

My 2c
Derek



You are right.

Martin

--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Is Django right for what I am trying to do

2010-07-09 Thread derek
On Jul 9, 12:29 am, Martin Tiršel  wrote:
> On Thu, 08 Jul 2010 23:23:53 +0200, Bradley Hintze  
>
>  wrote:
> > I guess I just don't like the model.py, views.py, templates, and
> > url.py. In the tutorial you have to edit all of these and THEN you get
> > something that you can send to the client. It's very confusing! How do
> > they tie together? I probably need to do the tutorial again. It seems
> > to me getting info from the user should be strait foreword but its not
> > as displayed by the rather lengthy tutorial. But than I'm new to
> > this...
>
> Hi, I am a Django beginner too. If you don't have experiences with MVC  
> programming pattern, it could be a lot harder, but as soon as you  
> understand it, you will not see many things so complicated. Django is a  
> framework which helps you to save time by not inventing a wheel again and  
> again, you don't need to know how Django's blackboxes works, you only need  
> to know how to use them to work for you. Forms are perfect example - you  
> specify what fields a form should have, what data should every field  
> contain and the boring part - displaying, validating and redisplaying you  
> can let to Django. If there is something you need to do differently as  
> default behaviour is, you can override it. Django is a little harder to  
> learn as I expected, but my advice is not to give up and try to read  
> documentation again and again until every part begins to fit together.
>
> What I am missing on Django, are high quality or complex tutorials.

More complex or more detailed?  (I would argue that The Django Book is
about as high quality as you are ever going to get for a free
tutorial)

Try: http://www.hoboes.com/NetLife/pytown/django-beyond-sql/

or: http://opensourcebridge.org/2009/wiki/Django%3A_Thinking_Outside_The_Blog

or: http://www.slideshare.net/jacobian/django-in-the-real-world-175

The real issue is that, because Django is a framework, designed to
meet N number of possible needs, once you get "beyond the basics", the
specifics start to diverge more and more from what _you_ actually need
to do.

My 2c
Derek

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Is Django right for what I am trying to do

2010-07-08 Thread Martin Tiršel
On Thu, 08 Jul 2010 23:23:53 +0200, Bradley Hintze  
 wrote:



I guess I just don't like the model.py, views.py, templates, and
url.py. In the tutorial you have to edit all of these and THEN you get
something that you can send to the client. It's very confusing! How do
they tie together? I probably need to do the tutorial again. It seems
to me getting info from the user should be strait foreword but its not
as displayed by the rather lengthy tutorial. But than I'm new to
this...



Hi, I am a Django beginner too. If you don't have experiences with MVC  
programming pattern, it could be a lot harder, but as soon as you  
understand it, you will not see many things so complicated. Django is a  
framework which helps you to save time by not inventing a wheel again and  
again, you don't need to know how Django's blackboxes works, you only need  
to know how to use them to work for you. Forms are perfect example - you  
specify what fields a form should have, what data should every field  
contain and the boring part - displaying, validating and redisplaying you  
can let to Django. If there is something you need to do differently as  
default behaviour is, you can override it. Django is a little harder to  
learn as I expected, but my advice is not to give up and try to read  
documentation again and again until every part begins to fit together.


What I am missing on Django, are high quality or complex tutorials. There  
is only small tutorial on django home page and a little better (and older)  
on djangobook.com, then good reference manual on home page (but with few  
real examples) and many blog posts about specific problems. The beginning  
is the hardest part. Try to create a real application, e.g. Content  
Management System or Blog or Photo gallery or whatever you want and ask  
for a help on specific problem you encounter during development, there are  
many good people who will help you.


Regards,
Martin

--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Is Django right for what I am trying to do

2010-07-08 Thread CLIFFORD ILKAY

On 07/08/2010 06:07 PM, Bradley Hintze wrote:

Thanks, that helps but I wish Django had more tutorial than one.


There is no shortage of Django tutorials and screencasts. Just Google 
for them. Showmedo.com, Vimeo, Blip.tv, and YouTube all have Django 
resources.

--
Regards,

Clifford Ilkay
Dinamis
1419-3266 Yonge St.
Toronto, ON
Canada  M4N 3P6


+1 416-410-3326

--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Is Django right for what I am trying to do

2010-07-08 Thread Rolando Espinoza La Fuente
On Thu, Jul 8, 2010 at 5:23 PM, Bradley Hintze
 wrote:
> I guess I just don't like the model.py, views.py, templates, and
> url.py. In the tutorial you have to edit all of these and THEN you get
> something that you can send to the client. It's very confusing! How do
> they tie together? I probably need to do the tutorial again. It seems
> to me getting info from the user should be strait foreword but its not
> as displayed by the rather lengthy tutorial. But than I'm new to
> this...

I think tutorial tries to show off django's features and how easy is to get
a data-driven web app with few code.

Anyway, django doesn't do any magic at all. You don't need models if you don't
store the information in a database. You don't need use django's templates
if you don't want.

Usually, in your view _you_ tie together the model with the template and
return a response which django pass to the user doing all the http stuff.

Try this:

""" file mytest.py """
# you require to return a HttpResponse instance in your view
from django.http import HttpResponse
# handler* are required for the urlresolver
from django.conf.urls.defaults import patterns, handler404, handler500

# minimal settings
DEBUG = True
# tell django to use this file to find urlpatterns. see below
ROOT_URLCONF = "mytest"

# a basic callback to return something to the user. "view" in django's idiom
def myview(request):
# you can use html content if you want
return HttpResponse("Boo!")

# finally tie a url route to our view
urlpatterns = patterns("",
# the regex is used to match whatever after /
# ^$ means "nothing", so route the url / to our callback "myview"
(r"^$", myview),
)

# /end


That's all you need. Then run: (you are in linux?)

$ PYTHONPATH=.  django-admin.py runserver --settings=mytest

PYTONPATH=. <- needed to tell python where to find our mytest.py
--settings=mytest  <- needed to tell django where to find the
"project's settings"

If you want learn and/or have more control over all the things and
stay "close to the iron",
you can try a micro-framework or go directly to wsgi. Search for:
werkzeug, web.py, flask, etc

Regards,

~Rolando

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Is Django right for what I am trying to do

2010-07-08 Thread Bradley Hintze
Thanks man!!

On Thu, Jul 8, 2010 at 6:11 PM, larsendt  wrote:
> Check out djangobook.com. It's a much longer tutorial, and really well
> written.
>
> On Jul 8, 4:07 pm, Bradley Hintze  wrote:
>> Thanks, that helps but I wish Django had more tutorial than one. I
>> seem to learn by example. I am trying to make an form for uploading
>> files but no matter how many times I read the documentation I cant
>> seem to get the form to the client, let alone how to store the file.
>> Do you know how to get objects from your model (FileForm) to your
>> template?
>>
>> On Thu, Jul 8, 2010 at 5:51 PM, CLIFFORD ILKAY
>>
>>
>>
>>
>>
>>  wrote:
>> > On 07/08/2010 05:23 PM, Bradley Hintze wrote:
>>
>> >> I guess I just don't like the model.py, views.py, templates, and
>> >> url.py. In the tutorial you have to edit all of these and THEN you get
>> >> something that you can send to the client. It's very confusing! How do
>> >> they tie together? I probably need to do the tutorial again. It seems
>> >> to me getting info from the user should be strait foreword but its not
>> >> as displayed by the rather lengthy tutorial. But than I'm new to
>> >> this...
>>
>> > It's actually pretty simple and logical. Here is a possibly over-simplified
>> > overview.
>>
>> > models.py is where you model your problem. If you have an entity "Books",
>> > you would have a Book model along with its attributes. From this model,
>> > Django will generate the database objects once you run syncdb.
>>
>> > urls.py is the place where you specify what happens when a particular URL 
>> > is
>> > requested. Django goes down the list of your regular expressions in there
>> > until it finds a match (or doesn't). Once it finds a match, the request is
>> > passed to the view function for that match. If it doesn't find a match,
>> > Django raises a 404 exception.
>>
>> > views.py is where you have the various functions that are invoked from
>> > urls.py handle the requests and pass the results to templates.
>>
>> > The templates are just HTML files with special tags embedded in them. Think
>> > of the tags as "holes" on the page that will eventually get filled by the
>> > data coming from view functions.
>>
>> > The Django framework ties all this together. For the purpose of the 
>> > tutorial
>> > and for writing apps, you really don't need to know the details of how it
>> > does that but of course if you want to, you can.
>> > --
>> > Regards,
>>
>> > Clifford Ilkay
>> > Dinamis
>> > 1419-3266 Yonge St.
>> > Toronto, ON
>> > Canada  M4N 3P6
>>
>> > 
>> > +1 416-410-3326
>>
>> > --
>> > You received this message because you are subscribed to the Google Groups
>> > "Django users" group.
>> > To post to this group, send email to django-us...@googlegroups.com.
>> > To unsubscribe from this group, send email to
>> > django-users+unsubscr...@googlegroups.com.
>> > For more options, visit this group at
>> >http://groups.google.com/group/django-users?hl=en.
>>
>> --
>> Bradley J. Hintze
>> Graduate Student
>> Duke University
>> School of Medicine
>> 801-712-8799
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To post to this group, send email to django-us...@googlegroups.com.
> To unsubscribe from this group, send email to 
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/django-users?hl=en.
>
>



-- 
Bradley J. Hintze
Graduate Student
Duke University
School of Medicine
801-712-8799

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Is Django right for what I am trying to do

2010-07-08 Thread larsendt
Check out djangobook.com. It's a much longer tutorial, and really well
written.

On Jul 8, 4:07 pm, Bradley Hintze  wrote:
> Thanks, that helps but I wish Django had more tutorial than one. I
> seem to learn by example. I am trying to make an form for uploading
> files but no matter how many times I read the documentation I cant
> seem to get the form to the client, let alone how to store the file.
> Do you know how to get objects from your model (FileForm) to your
> template?
>
> On Thu, Jul 8, 2010 at 5:51 PM, CLIFFORD ILKAY
>
>
>
>
>
>  wrote:
> > On 07/08/2010 05:23 PM, Bradley Hintze wrote:
>
> >> I guess I just don't like the model.py, views.py, templates, and
> >> url.py. In the tutorial you have to edit all of these and THEN you get
> >> something that you can send to the client. It's very confusing! How do
> >> they tie together? I probably need to do the tutorial again. It seems
> >> to me getting info from the user should be strait foreword but its not
> >> as displayed by the rather lengthy tutorial. But than I'm new to
> >> this...
>
> > It's actually pretty simple and logical. Here is a possibly over-simplified
> > overview.
>
> > models.py is where you model your problem. If you have an entity "Books",
> > you would have a Book model along with its attributes. From this model,
> > Django will generate the database objects once you run syncdb.
>
> > urls.py is the place where you specify what happens when a particular URL is
> > requested. Django goes down the list of your regular expressions in there
> > until it finds a match (or doesn't). Once it finds a match, the request is
> > passed to the view function for that match. If it doesn't find a match,
> > Django raises a 404 exception.
>
> > views.py is where you have the various functions that are invoked from
> > urls.py handle the requests and pass the results to templates.
>
> > The templates are just HTML files with special tags embedded in them. Think
> > of the tags as "holes" on the page that will eventually get filled by the
> > data coming from view functions.
>
> > The Django framework ties all this together. For the purpose of the tutorial
> > and for writing apps, you really don't need to know the details of how it
> > does that but of course if you want to, you can.
> > --
> > Regards,
>
> > Clifford Ilkay
> > Dinamis
> > 1419-3266 Yonge St.
> > Toronto, ON
> > Canada  M4N 3P6
>
> > 
> > +1 416-410-3326
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Django users" group.
> > To post to this group, send email to django-us...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > django-users+unsubscr...@googlegroups.com.
> > For more options, visit this group at
> >http://groups.google.com/group/django-users?hl=en.
>
> --
> Bradley J. Hintze
> Graduate Student
> Duke University
> School of Medicine
> 801-712-8799

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Is Django right for what I am trying to do

2010-07-08 Thread Bradley Hintze
Thanks, that helps but I wish Django had more tutorial than one. I
seem to learn by example. I am trying to make an form for uploading
files but no matter how many times I read the documentation I cant
seem to get the form to the client, let alone how to store the file.
Do you know how to get objects from your model (FileForm) to your
template?

On Thu, Jul 8, 2010 at 5:51 PM, CLIFFORD ILKAY
 wrote:
> On 07/08/2010 05:23 PM, Bradley Hintze wrote:
>>
>> I guess I just don't like the model.py, views.py, templates, and
>> url.py. In the tutorial you have to edit all of these and THEN you get
>> something that you can send to the client. It's very confusing! How do
>> they tie together? I probably need to do the tutorial again. It seems
>> to me getting info from the user should be strait foreword but its not
>> as displayed by the rather lengthy tutorial. But than I'm new to
>> this...
>
> It's actually pretty simple and logical. Here is a possibly over-simplified
> overview.
>
> models.py is where you model your problem. If you have an entity "Books",
> you would have a Book model along with its attributes. From this model,
> Django will generate the database objects once you run syncdb.
>
> urls.py is the place where you specify what happens when a particular URL is
> requested. Django goes down the list of your regular expressions in there
> until it finds a match (or doesn't). Once it finds a match, the request is
> passed to the view function for that match. If it doesn't find a match,
> Django raises a 404 exception.
>
> views.py is where you have the various functions that are invoked from
> urls.py handle the requests and pass the results to templates.
>
> The templates are just HTML files with special tags embedded in them. Think
> of the tags as "holes" on the page that will eventually get filled by the
> data coming from view functions.
>
> The Django framework ties all this together. For the purpose of the tutorial
> and for writing apps, you really don't need to know the details of how it
> does that but of course if you want to, you can.
> --
> Regards,
>
> Clifford Ilkay
> Dinamis
> 1419-3266 Yonge St.
> Toronto, ON
> Canada  M4N 3P6
>
> 
> +1 416-410-3326
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-us...@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>



-- 
Bradley J. Hintze
Graduate Student
Duke University
School of Medicine
801-712-8799

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Is Django right for what I am trying to do

2010-07-08 Thread CLIFFORD ILKAY

On 07/08/2010 05:23 PM, Bradley Hintze wrote:

I guess I just don't like the model.py, views.py, templates, and
url.py. In the tutorial you have to edit all of these and THEN you get
something that you can send to the client. It's very confusing! How do
they tie together? I probably need to do the tutorial again. It seems
to me getting info from the user should be strait foreword but its not
as displayed by the rather lengthy tutorial. But than I'm new to
this...


It's actually pretty simple and logical. Here is a possibly 
over-simplified overview.


models.py is where you model your problem. If you have an entity 
"Books", you would have a Book model along with its attributes. From 
this model, Django will generate the database objects once you run syncdb.


urls.py is the place where you specify what happens when a particular 
URL is requested. Django goes down the list of your regular expressions 
in there until it finds a match (or doesn't). Once it finds a match, the 
request is passed to the view function for that match. If it doesn't 
find a match, Django raises a 404 exception.


views.py is where you have the various functions that are invoked from 
urls.py handle the requests and pass the results to templates.


The templates are just HTML files with special tags embedded in them. 
Think of the tags as "holes" on the page that will eventually get filled 
by the data coming from view functions.


The Django framework ties all this together. For the purpose of the 
tutorial and for writing apps, you really don't need to know the details 
of how it does that but of course if you want to, you can.

--
Regards,

Clifford Ilkay
Dinamis
1419-3266 Yonge St.
Toronto, ON
Canada  M4N 3P6


+1 416-410-3326

--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Is Django right for what I am trying to do

2010-07-08 Thread Bradley Hintze
I guess I just don't like the model.py, views.py, templates, and
url.py. In the tutorial you have to edit all of these and THEN you get
something that you can send to the client. It's very confusing! How do
they tie together? I probably need to do the tutorial again. It seems
to me getting info from the user should be strait foreword but its not
as displayed by the rather lengthy tutorial. But than I'm new to
this...

On Thu, Jul 8, 2010 at 5:08 PM, Daniel Roseman  wrote:
> On Jul 8, 6:43 pm, Bradley Hintze  wrote:
>> Hi all
>>
>> I did the tutorial and I've spent the last two days in the
>> documentation trying, and failing, to figure out how to tie my model
>> to a view and ultimately a template that is served. The documentation
>> seems to do a lot of things (like write html) automatically which is
>> not what I want (seehttp://docs.djangoproject.com/en/dev/topics/forms/).  I 
>> am not
>> interested in admin sites, they make things easier but I am interested
>> in learning the code (i.e. the HTML and how it communicates with
>> python) rather than, in my view, just blackbox automation.
>>
>> I hope this makes sense. Please tell me if it doesn't.  I want to
>> simply upload a file and then process the file using code I already
>> have. I would like to write the HTML code myself rather then having
>> django automatically do it. This is because I want to learn how to
>> process forms and not have a black box do everything for me. Are there
>> methods to simply get post data from a form that I write rather the
>> django automatically creating it (an example maybe)? are models
>> necessary for what I'm explaining? Is django right for what I'm
>> explaining?
>>
>> --
>> Bradley J. Hintze
>> Graduate Student
>> Duke University
>> School of Medicine
>> 801-712-8799
>
> Django doesn't write any HTML for you. The admin is an automatically-
> created system, true, but that has nothing to do with the pages you
> serve to your users. And the forms documentation you point to shows
> how to generate a form and display it in the template without
> 'automatically creating it' - is there anything here:
> http://docs.djangoproject.com/en/dev/topics/forms/#customizing-the-form-template
> that doesn't make sense to you? The only thing 'automatic' about that
> example is that you type {{ form.subject }} and Django outputs  id="id_subject">.
> --
> DR.
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To post to this group, send email to django-us...@googlegroups.com.
> To unsubscribe from this group, send email to 
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/django-users?hl=en.
>
>



-- 
Bradley J. Hintze
Graduate Student
Duke University
School of Medicine
801-712-8799

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Is Django right for what I am trying to do

2010-07-08 Thread Daniel Roseman
On Jul 8, 6:43 pm, Bradley Hintze  wrote:
> Hi all
>
> I did the tutorial and I've spent the last two days in the
> documentation trying, and failing, to figure out how to tie my model
> to a view and ultimately a template that is served. The documentation
> seems to do a lot of things (like write html) automatically which is
> not what I want (seehttp://docs.djangoproject.com/en/dev/topics/forms/).  I 
> am not
> interested in admin sites, they make things easier but I am interested
> in learning the code (i.e. the HTML and how it communicates with
> python) rather than, in my view, just blackbox automation.
>
> I hope this makes sense. Please tell me if it doesn't.  I want to
> simply upload a file and then process the file using code I already
> have. I would like to write the HTML code myself rather then having
> django automatically do it. This is because I want to learn how to
> process forms and not have a black box do everything for me. Are there
> methods to simply get post data from a form that I write rather the
> django automatically creating it (an example maybe)? are models
> necessary for what I'm explaining? Is django right for what I'm
> explaining?
>
> --
> Bradley J. Hintze
> Graduate Student
> Duke University
> School of Medicine
> 801-712-8799

Django doesn't write any HTML for you. The admin is an automatically-
created system, true, but that has nothing to do with the pages you
serve to your users. And the forms documentation you point to shows
how to generate a form and display it in the template without
'automatically creating it' - is there anything here:
http://docs.djangoproject.com/en/dev/topics/forms/#customizing-the-form-template
that doesn't make sense to you? The only thing 'automatic' about that
example is that you type {{ form.subject }} and Django outputs .
--
DR.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Is Django right for what I am trying to do

2010-07-08 Thread Bradley Hintze
Hi all

I did the tutorial and I've spent the last two days in the
documentation trying, and failing, to figure out how to tie my model
to a view and ultimately a template that is served. The documentation
seems to do a lot of things (like write html) automatically which is
not what I want (see
http://docs.djangoproject.com/en/dev/topics/forms/).  I am not
interested in admin sites, they make things easier but I am interested
in learning the code (i.e. the HTML and how it communicates with
python) rather than, in my view, just blackbox automation.

I hope this makes sense. Please tell me if it doesn't.  I want to
simply upload a file and then process the file using code I already
have. I would like to write the HTML code myself rather then having
django automatically do it. This is because I want to learn how to
process forms and not have a black box do everything for me. Are there
methods to simply get post data from a form that I write rather the
django automatically creating it (an example maybe)? are models
necessary for what I'm explaining? Is django right for what I'm
explaining?

-- 
Bradley J. Hintze
Graduate Student
Duke University
School of Medicine
801-712-8799

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.