简体   繁体   中英

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?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM