Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with path of CSS #1

Closed
vietjovi opened this issue Apr 8, 2013 · 6 comments
Closed

Problem with path of CSS #1

vietjovi opened this issue Apr 8, 2013 · 6 comments
Assignees

Comments

@vietjovi
Copy link
Collaborator

vietjovi commented Apr 8, 2013

[08/Apr/2013 15:36:01] "GET /admin_media/css/forms.css HTTP/1.0" 404 6492
[08/Apr/2013 15:36:01] "GET /admin_media/css/base.css HTTP/1.0" 404 6491
[08/Apr/2013 15:36:01] "GET /admin_media/css/changelists.css HTTP/1.0" 404 6498
[08/Apr/2013 15:37:32] "GET /admin/settings/users/ HTTP/1.0" 200 13571
[08/Apr/2013 15:37:32] "GET /admin_media/css/base.css HTTP/1.0" 404 6491
[08/Apr/2013 15:37:32] "GET /admin_media/css/changelists.css HTTP/1.0" 404 6498
[08/Apr/2013 15:37:32] "GET /admin_media/css/forms.css HTTP/1.0" 404 6492

@dangtrinhnt
Copy link
Contributor

You should put the admin media folder ("admin") inside your site media folder

@ghost ghost assigned vietjovi Apr 8, 2013
@nghitran
Copy link
Owner

nghitran commented Apr 8, 2013

According to this link: https://docs.djangoproject.com/en/1.4/releases/1.4/#what-s-new-in-django-1-4

If you’re implicitly relying on the path of the admin static files within Django’s source code, you’ll need to update that path. The files were moved from django/contrib/admin/media/ to django/contrib/admin/static/admin/

So you need to make an Alias in your VirtualHost config to the new link.

For example:

Alias /admin_media/ /path/to/virtualenv/lib/python2.7/site-packages/django/contrib/admin/static/admin/
    <Directory /path/to/virtualenv/lib/python2.7/site-packages/django/contrib/admin/static/admin>
            Order allow,deny
            Allow from all
    </Directory>"

@dangtrinhnt
Copy link
Contributor

I solved this issue before as simple as copying the admin media folder of Django to the project's site media

@nghitran
Copy link
Owner

nghitran commented Apr 8, 2013

I solved this issue before as simple as copying the admin media folder of Django to the project's site media

This will require you to commit all that static files to git

@nghitran nghitran closed this as completed Apr 8, 2013
@vietjovi
Copy link
Collaborator Author

vietjovi commented Apr 8, 2013

I 'm using nginx.
I edited file /etc/nginx/sites-enabled/osqa.conf to create an Alias.

location /admin_media/ {
alias /home/vietjovi/pyenv/lib/python2.7/site-packages/django/contrib/admin/static/admin/;
}

It 's OK, \m/
Thanks

@dangtrinhnt
Copy link
Contributor

You only have to use nginx in the production environment. I think that's why you faced this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants