On Tue, Jul 19, 2011 at 9:19 AM, Alex Hall <mehg...@gmail.com> wrote:
> > 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? > > Dont you have a urls.py in your project? Something like this will take you to the "/" of the site: url(r'^$' ,'index' ,{}, name="index"), > 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! > Since all the 3 tables relate to a 'single' functionality - this is fine. -V -- 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+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.