3

Location of django:

/usr/lib/python2.7/dist-packages/django/__init__.pyc

Location of django oscar:

/usr/local/lib/python2.7/dist-packages/oscar/__init__.pyc

My static files are not getting served properly. Above is my production setting. On my local machine, the locations are:

/usr/local/lib/python2.7/dist-packages/oscar/__init__.pyc
/usr/lib/python2.7/dist-packages/django/__init__.pyc

Could this be a possible reason for above problem?

toothie
  • 1,019
  • 4
  • 20
  • 47
  • 1
    If you could explain more about your setup, it would be easier to help you. How are you serving your Django project? Are you just running `manage.py runserver` or have you setup something like an Nginx reverse proxy? – andrewsomething Oct 09 '14 at 16:16
  • I'm using Digital Ocean's service. It has gunicorn and nginx pre installed and pre-configured for my django app. – toothie Oct 09 '14 at 16:44

1 Answers1

6

Oscar ships its own set of static files in oscar/static/oscar When you deploy your site, you should run manage.py collectstatic so these files are also collected in your STATIC_ROOT

On DigitalOcean's Django app, your Nginx configuration is located in /etc/nginx/sites-enabled/django You may need to update the following section to point to the location of your STATIC_ROOT

    # your Django project's static files - amend as required
    location /static {
        alias /home/django/django_project/django_project/static; 
    }
andrewsomething
  • 2,146
  • 2
  • 18
  • 22
  • Thank you so much for the help. Now it has got another problem though. When I set debug=False, the site gives internal error. I have put the ip address and domain name in the list of allowed hosts. – toothie Oct 10 '14 at 06:32
  • Also, all the images in my 'media' folder specified by "MEDIA_ROOT" returns a 403 forbidden error. This folder contains dynamically created and some static images too. – toothie Oct 10 '14 at 07:04