This looks like you are missing the link between your web server and
the django code. I do not know how dreamhost works but for django to
work you need to tell your web server: "hey server when you get a
request for www.mysite.com don't just try to serve index.html from a
root directory, i want you to go to my django project directory and
run the python interpreter on the files there and start serving the
output of the python interpreter"

You get the point? There are no pages in django, there is code that
generates html output according to certain rules, the code is written
in python a language that the webserver will not natively understand
so it needs a ceratin module in apache it would be mod_python or
mod_wsgi. You have to setup the server to use this module for your
project site. You will also need to make an exception for images/css/
js files ie. the static files that are not output of django code,
these files need to be served in the regular way.

This might not be the direct solution to your problem but I hope it
helps get it a picture of how django works.

On Nov 4, 8:39 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> So, I added this to the urlpatterns var:
>
> (r'^$', 'mysite.polls.views.current_datetime'),
>
> ...and this to views.py located in the polls directory
>
> from django.http import HttpResponse
> import datetime
>
> def current_datetime(request):
>     now = datetime.datetime.now()
>     html = "<html><body>It is now %s.</body></html>" % now
>     return HttpResponse(html)
>
> When I open a browser and go tohttp://www.mysite.comI wind up in the
> mysite.com directory on my Dreamhost server, rather than the url being
> mapped to the django site located at /home/username/projects/mysite.
>
> Thanks,
>
> Jason
>
> On Nov 3, 4:10 pm, Steve Holden <[EMAIL PROTECTED]> wrote:
>
> > [EMAIL PROTECTED] wrote:
> > > I understand the mapping of urls.py but I guess I'm not clear on a few
> > > things to begin with, like what is the equivalent to an index.html
> > > page in django? I know that the system works off of a template system
> > > like using "base.html" as the design skeleton for a site and extending
> > > that system with calls to different views, but what happens when I
> > > want to just request the index page for a django site? Let's say I
> > > register and add a subdomain to my Dreamhost account say...
> > > mysite.com, when I issue the startproject command as django-admin.py
> > > startproject mysite is there some sort of connection between the two?
> > > Do I scrap the Dreamhost generated directory "mysite.com" and the
> > > actual command I should be issuing is django-admin.py startproject
> > > mysite.COM? What is returned for an index page if there is no
> > > ndex.html or index.php?
>
> > Your site's root page is whatever is mapped to r"^$", the empty URL.
>
> > It's the same for directories. If you *want* to map something on to
> > .../something.html you can, but there is no need to. When a
> > "directory-like URL" is passed by a browser the returned result is
> > whatever is generated by the view the the URL is mapped to. Or a 404 if
> > no such mapping can be found.
>
> > regards
> >  Steve
--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to