Wednesday, January 27, 2016

Django linking static content to dynamic content

Hello,

I have implemented authentication via django allauth. I am trying to link UI which is loosely coupled with django.
I am able to get to the index page by all other static content throes a 404 error. Appreciate any help on this.
I have gone thro https://docs.djangoproject.com/en/1.8/howto/static-files/ but I guess I am missing something.

Here is what I have tried:

1. I have copied all my html code to templates folder

2. Created symbolic links to the location of my static files under BASE_DIR

3. Here is my settings.py

TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [os.path.join(BASE_DIR, 'templates')],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
},
},
]
STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(BASE_DIR, "static")
STATICFILES_DIRS = (
os.path.join(BASE_DIR, "templates/static"),
os.path.join(BASE_DIR, "css"),
os.path.join(BASE_DIR, "img"),
os.path.join(BASE_DIR, "js"),
)

- S


--
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+unsubscribe@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/6e4cd43e-4ce2-41c9-9788-f78fd5e77e5e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment