Thank you. Yes, I didn't set "Alias /static/ /path/to/mysite.com/static/" in my 
site config. 
However, when I set that alias, I met another problem as the following picture. 
As the picture, my models don't have "Add" and "Change" button, which they have 
when I run this site on development server or when I just set DEBUG in 
settings.py to True.
 




Dae James

From: Tomas Ehrlich
Date: 2012-10-19 00:48
To: django-users
Subject: Re: Question in document "How to use Django with Apache and mod_wsgi"
Hello,
have you set proper aliases in apache site config?

Alias /robots.txt /path/to/mysite.com/static/robots.txt
Alias /favicon.ico /path/to/mysite.com/static/favicon.ico

AliasMatch ^/([^/]*\.css) /path/to/mysite.com/static/styles/$1

Alias /media/ /path/to/mysite.com/media/
Alias /static/ /path/to/mysite.com/static/

<Directory /path/to/mysite.com/static>
Order deny,allow
Allow from all
</Directory>

<Directory /path/to/mysite.com/media>
Order deny,allow
Allow from all
</Directory>

or similar. Check that apache can read
directories /path/to/mysite.com/{static,media} ...

You should have appropriate settings in your settings.py, eg.

MEDIA_URL = '/media/'
STATIC_URL = '/static/'

MEDIA_ROOT and STATIC_ROOT aren't important in this case.

Then, take a look at you access.log, if there is something relevant.

Does it works now? If no, please send your settings.py and apache site
config file. (Don't forget to delete sensitive data from settings.py
before posting here).

Cheers,
 Tom


Dne Thu, 18 Oct 2012 06:39:13 -0700 (PDT)
Dae_James <daeda...@126.com> napsal(a):

> The url of the document is: 
> https://docs.djangoproject.com/en/1.4/howto/deployment/wsgi/modwsgi/
> I can't succeed at the last part, "Serving the admin files".  My admin page 
> is as follows.
> 
> <https://lh3.googleusercontent.com/-JvizcFwx52s/UIADfuCY-UI/AAAAAAAAAAM/59oDrVVuHzA/s1600/Untitled20121018212559.png>
> I have tried two ways. However both can't succeed.
> First means is as the following steps:
> 1, Activate the admin site following 
> https://docs.djangoproject.com/en/1.4/intro/tutorial02/
> 2, Execute "manage.py collectstatic" in console.
> 3, Start mob_wsgi.
> 
> Second means is as the following steps:
> 1, Activate the admin site following 
> https://docs.djangoproject.com/en/1.4/intro/tutorial02/
> 2, Copy the admin files live in (django/contrib/admin/static/admin) into my 
> Apache document root(C:\Program Files\Apache Software 
> Foundation\Apache2.2\htdocs)
> 3, Start mob_wsgi
> 
> Help, please! Thank you~~
> 

-- 
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.

-- 
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.

<<Untitled20121019094521.png>>

Reply via email to