Skip to content

Instantly share code, notes, and snippets.

@Jungwoo-An
Created August 21, 2018 13:04
Show Gist options
  • Save Jungwoo-An/9cb055a5ec0328b3d4803606de124df4 to your computer and use it in GitHub Desktop.
Save Jungwoo-An/9cb055a5ec0328b3d4803606de124df4 to your computer and use it in GitHub Desktop.
Django spa config
STATIC_URL = '/static/'
STATICFILES_DIRS = (os.path.join(BASE_DIR, 'static'),)
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [os.path.join(BASE_DIR, 'static')],
'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',
],
},
},
]
urlpatterns = [
path('api/', lambda request: HttpResponse('API')),
url(r'.*', TemplateView.as_view(template_name='index.html')),
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment