This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{# templates/polls/index.html #} | |
{% load static %} | |
{% include '_auto_generated/development/js_bundle.html' %} | |
<link rel="stylesheet" type="text/css" href="{% static 'styles/index.css' %}"> | |
<style> | |
body { | |
background: white url({% static 'images/background.gif' %}) no-repeat; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict' | |
// web_assets/js/IndexCoordinator.entry.js | |
class IndexClass { | |
initialize() { | |
console.log('Test'); | |
window.alert('Build Successful!!'); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# templates/_auto_generated/development/.gitignore | |
# Ignore all files within this directory except the gitignore | |
* | |
!.gitignore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
// _webpack_files/supporting/webpack_utils.js | |
const crypto = require('crypto'); | |
const glob = require('glob'); | |
// The directory name where the web assets that need to be compiled live | |
let assetsDirname = 'web_assets'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
// _webpack_files/webpack.config.js | |
/* | |
* This is the base config file that contains shared configurations for both production and development | |
* */ | |
const MiniCssExtractPlugin = require('mini-css-extract-plugin'); | |
const HtmlWebpackPlugin = require('html-webpack-plugin'); | |
const { CleanWebpackPlugin } = require('clean-webpack-plugin'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// babel.config.js | |
module.exports = { | |
presets: [ | |
[ | |
'@babel/preset-env', | |
{ | |
targets: { | |
node: 'current', | |
}, | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "webpack_multipage", | |
"version": "1.0.0", | |
"description": "", | |
"main": "index.js", | |
"scripts": { | |
"build": "node --max_old_space_size=4096 ./node_modules/webpack/bin/webpack.js --config ./_webpack_files/webpack.config.js", | |
"build-watch": "webpack --config ./_webpack_files/webpack.watch.config.js" | |
}, | |
"author": "", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{# templates/polls/index.html #} | |
{% load static %} | |
<link rel="stylesheet" type="text/css" href="{% static 'styles/style.css' %}"> | |
<style> | |
body { | |
background: white url({% static 'images/background.gif' %}) no-repeat; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# webpack_multipage/settings.py | |
###### | |
TEMPLATES = [ | |
{ | |
'BACKEND': 'django.template.backends.django.DjangoTemplates', | |
'DIRS': [ | |
os.path.join(BASE_DIR, 'templates'), # Add this line | |
], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# polls/admin.py | |
from django.contrib import admin | |
from .models import Question, Choice | |
class ChoiceInline(admin.StackedInline): | |
model = Choice | |
extra = 3 |