> Thanks.  The diagram clarified what I'd already thought to a degree, 
> although I'd gotten confused by the warning in the documentation for 
> STATIC_ROOT, which says 
>

"
This should be an initially empty destination directory for collecting your 
static files from their permanent locations into one directory for ease of 
deployment; it is *not* a place to store your static files permanently. You 
should do that in directories that will be found by staticfiles 
<https://docs.djangoproject.com/en/1.11/ref/contrib/staticfiles/>’s finders 
<https://docs.djangoproject.com/en/1.11/ref/settings/#std:setting-STATICFILES_FINDERS>,
 
which by default, are 'static/' app sub-directories and any directories you 
include in STATICFILES_DIRS 
<https://docs.djangoproject.com/en/1.11/ref/settings/#std:setting-STATICFILES_DIRS>
).
"

 I've set the variables in my settings.py;
STATIC_ROOT = "C:/inetpub/wwwroot/shopfront/static/"
STATIC_URL = '/static/'

I've added 'django.contrib.staticfiles', to my INSTALLED_APPS

> I've run the collectstatic and it did indeed put my handful of static 
files in \static\ grouped into their respective folders.

I've even added  the STATICFILES_FINDERS to my settings.py

STATICFILES_FINDERS = [
    'django.contrib.staticfiles.finders.DefaultStorageFinder',
    'django.contrib.staticfiles.finders.FileSystemFinder',
    'django.contrib.staticfiles.finders.AppDirectoriesFinder',
]

When I view the source of my page, I can see the url built from "{% static 
my_apps.app_icon %}" resolves to /static/images/filename.png

To be sure, I wasn't going totally mad I added the following to my urls.py 
and re-enabled DEBUG

from django.conf import settingsfrom django.conf.urls.static import static
urlpatterns = [
    # ... the rest of your URLconf goes here ...] + static(settings.STATIC_URL, 
document_root=settings.STATIC_ROOT)


and low and behold, it worked just fine but I obviously cannot leave it 
like that.

Having gone through the tutorial, I thought Django would be a great tool 
but I seem to be struggling with the most simple of things and I've barely 
started this project, I'm just trying to test out some basics including the 
deployment.

Kind regards,

  Tony

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/4dd09450-11d0-49da-b21e-dae4856752cf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to