Search code examples
pythondjangodigital-oceandjango-oscar

Django and django oscar


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?


Solution

  • 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; 
        }