-
Notifications
You must be signed in to change notification settings - Fork 127
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
Serving static files #7
Comments
Well, without explicit testing I can tell there is a few different minor issues with your media files configuration and I also believe you found a bug for the same topic. I actually would like to know if your application has any media files (such as user uploads, avatars etc) because they seem to be the displaying issues. Let's go one by one:
And the bug I was talking about, your media directory in nginx perfectly points to where the application default settings points, just under its root directory. I am not sure at this point if nginx matches these prefix patterns with the first-match basis or if there is a kind of longest-length matching prefix algorithm but if a developer choose to stick to default Besides this ambiguity, there is also another For this case you can easily resolve it either by:
Thanks for raising these issues. I will leave this issue open until it gets obvious about managing media files, even though there is little space to blame |
Thanks for your reply, I've not edited nor added anything to your sample app. I'm just testing in a Intranet environment how to deploy it, that it will work as if i would So I made the I renamed the local.py and edited the default.py STATIC_ROOT = '%s/static' % ABS_PROJECT_ROOT The URL that handles the media, static, etc. In this URL section I tried, with and without STATIC_URL I still think it's more of a knowledge issue and guides online don't take this step into details, much appreciation for your support! |
Hello, I can't really understand why as I'm not familiar to django but an explaination is welcome |
Hi there,
this is more a newbie question but after many hours spent troubleshooting, and found many un resolved questions on StackOverflow I thought I might ask!
First of all props for the project, as it's very useful for someone that wants to start on django!
On the Sys admin side, as I would like to have a production website in the future and I'm testing it.
Why while serving the website through Nginx and uWSGI, pointing to the static correctly
I still see a "broken" (of css and js) site?
at first I had the nginx config wrong, now I get no errors but still can't see the website properly.
Do I have to delete local.py and just keep default.py?
are there any specific permissions to be added?
Everything is run and owned by www-data, socket permissions on 774
Thanks a lot!
here some info of the setup
manage.py collectstatic
You have requested to collect static files at the destination
location as specified in your settings:
/home/django/sample/static
root@bananapi /home/django # tree -d sample
sample
├── media
├── sample
│ ├── home
│ └── settings
├── static
│ ├── admin
│ │ ├── css
│ │ ├── img
│ │ │ └── gis
│ │ └── js
│ │ └── admin
│ ├── CACHE
│ │ ├── css
│ │ └── js
│ ├── css
│ ├── django_extensions
│ │ ├── css
│ │ ├── img
│ │ └── js
│ ├── images
│ ├── js
│ ├── libs
│ │ ├── bootstrap-3.3.5
│ │ │ ├── css
│ │ │ ├── fonts
│ │ │ └── js
│ │ ├── font-awesome-4.3.0
│ │ │ ├── css
│ │ │ ├── fonts
│ │ │ ├── less
│ │ │ └── scss
│ │ ├── jquery
│ │ │ └── 2.1.0
│ │ └── modernizr
│ │ └── 2.6.2
│ └── media
├── static-assets
│ ├── css
│ ├── images
│ ├── js
│ ├── libs
│ │ ├── bootstrap-3.3.5
│ │ │ ├── css
│ │ │ ├── fonts
│ │ │ └── js
│ │ ├── font-awesome-4.3.0
│ │ │ ├── css
│ │ │ ├── fonts
│ │ │ ├── less
│ │ │ └── scss
│ │ ├── jquery
│ │ │ └── 2.1.0
│ │ └── modernizr
│ │ └── 2.6.2
│ └── media -> ../media/
└── templates
nginx.conf
upstream sample {
server unix:/home/django/sample/sample.sock;
}
server {
listen 80;
server_name bananapi;
access_log off;
The text was updated successfully, but these errors were encountered: