Electronics & Programming

develissimo

Open Source electronics development and programming

  • You are not logged in.
  • Root
  • » Django
  • » Beginner questions: on the official polls tutorial [RSS Feed]

#1 Jan. 6, 2011 01:04:55

Z.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

Beginner questions: on the official polls tutorial


I started with the official tutorial to build the polls app.
Everything works fine. I then tried to use wsgi on Apache. Everything
still works, though with some defects explained below. I have a few
questions to ask as a beginner:

Assume I create mysite under E:\www.

1. In the settings.py file, there is a line to set the ROOT_URLCONF:

ROOT_URLCONF = 'mysite.urls'

However, sys.path is configured to contain 'E:\www\mysite' not 'E:
\www'. So how can python find the module mysite.urls? In the tutorial
example, everything works fine, and I don't know why. When I moved to
wsgi+Apache, I had to either add 'E:\www' to sys.path or change
'mysite.urls' to 'urls' to make things work.

2. After I moved to wsgi+Apache, the 'fancy' admin site was gone.
Although the basic functions seem to be still there, each page became
plain text as in the polls app.

3. Do I have to restart the apache server every time after I add,
modify or remove files?

Thanks,
Zheng


--
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 athttp://groups.google.com/group/django-users?hl=en.

Offline

#2 Jan. 6, 2011 02:24:23

Shawn M.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

Beginner questions: on the official polls tutorial


1. When you were running the development server, you were probably executing
from the www directory, so importing from 'mysite' would work. When running in
production, it has to be properly on the PYTHONPATH.

2. You need the CSS and stuff for admin available on a server somewhere, and
have your ADMIN_MEDIA_PREFIX in settings.py point to the proper root URL.

3. I don't know that one personally, and I don't use Apache. Someone else will
probably answer.

Shawn

--
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 athttp://groups.google.com/group/django-users?hl=en.

Offline

#3 Jan. 6, 2011 02:35:08

Zheng L.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

Beginner questions: on the official polls tutorial


Thank you, Shawn.

On Wed, Jan 5, 2011 at 8:24 PM, Shawn Milochik <sh...@milochik.com> wrote:

> 1. When you were running the development server, you were probably
> executing from the www directory, so importing from 'mysite' would work.
> When running in production, it has to be properly on the PYTHONPATH.
>

I actually was executing from www/mysite, so why it works still seems
mysterious to me.


>
> 2. You need the CSS and stuff for admin available on a server somewhere,
> and have your ADMIN_MEDIA_PREFIX in settings.py point to the proper root
> URL.
>
> 3. I don't know that one personally, and I don't use Apache. Someone else
> will probably answer.
>
> Shawn
>
> --
> 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<django-users%2bunsubscr...@googlegroups.com>
> .
> For more options, visit this group at
>http://groups.google.com/group/django-users?hl=en.
>
>

--
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 athttp://groups.google.com/group/django-users?hl=en.

Offline

#4 Jan. 6, 2011 16:27:25

s.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

Beginner questions: on the official polls tutorial


3. You need to restart it only after you modify apache config files.

On 6 Janv., 02:52, Zheng <smile...@gmail.com> wrote:
> I started with the official tutorial to build the polls app.
> Everything works fine. I then tried to use wsgi on Apache. Everything
> still works, though with some defects explained below. I have a few
> questions to ask as a beginner:
>
> Assume I create mysite under E:\www.
>
> 1. In the settings.py file, there is a line to set the ROOT_URLCONF:
>
> ROOT_URLCONF = 'mysite.urls'
>
> However, sys.path is configured to contain 'E:\www\mysite' not 'E:
> \www'. So how can python find the module mysite.urls? In the tutorial
> example, everything works fine, and I don't know why. When I moved to
> wsgi+Apache, I had to either add 'E:\www' to sys.path or change
> 'mysite.urls' to 'urls' to make things work.
>
> 2. After I moved to wsgi+Apache, the 'fancy' admin site was gone.
> Although the basic functions seem to be still there, each page became
> plain text as in the polls app.
>
> 3. Do I have to restart the apache server every time after I add,
> modify or remove files?
>
> Thanks,
> Zheng

--
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 athttp://groups.google.com/group/django-users?hl=en.

Offline

  • Root
  • » Django
  • » Beginner questions: on the official polls tutorial [RSS Feed]

Board footer

Moderator control

Enjoy the 13th of December
PoweredBy

The Forums are managed by develissimo stuff members, if you find any issues or misplaced content please help us to fix it. Thank you! Tell us via Contact Options
Leave a Message
Welcome to Develissimo Live Support