Monday, July 18, 2011

setting up homepage, and naming/organizing apps

Hello all,
I was on this list a few months ago, but was unable to get a
django-friendly web host. I am now helping with a site on Bluehost,
which does support django, and I am hoping to be given permission by
the guy in charge to use django instead of php for our project.

I have been going through the tutorial, adapting it to my project as
necessary, and have a couple questions.

1. This must be glaringly obvious, but how do I use django to load my
homepage (index.html in the public_html root)? I understand about
views and url matching, but there is no views.py in the main directory
and I am not sure if I am supposed to create one or not. In other
words, how does django know where to find the page to load when a
visitor simply goes to mysite.com, instead of
mysite.com/something_to_match?

2. The project I am working on has a few tables: media, articles, and
authors. An article can have one author and one or more rows in the
media table associated with it. I currently have an app called
"tables", in which I plan to define the three tables in models.py (I
am only working with authors as a test). All my views, urls, and so
forth will be inside this tables app. Is this generally recommended,
or should I have an app for each table? The tutorial has two tables
defined, but the urls are all /polls/[something], whereas my urls
might be /authors/, /author/[id], /article/[id], and so on (not
sharing /[app_name]/... like the tutorial does). I hope that made
sense!

--
Have a great day,
Alex (msg sent from GMail website)
mehgcap@gmail.com; http://www.facebook.com/mehgcap

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

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate