On Tuesday, 19 July 2011 04:49:00 UTC+1, Alex wrote: > > 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? > > I don't know why you mention "index.html in the public_html root". Django pages are dynamic and are not served from the html_root. You could set up your webserver to look there for URLs matching / only, but are you sure you don't have *any* dynamic or database-based content in your home page? Not even a menu? Seems strange. Normally, you would just set up a url to match r'^$' and route to a view in the normal way.
> 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! > No, you have it right. These three models are clearly all related, so belong together in one app. -- DR. -- 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/-/nfqCPDHakM4J. 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.