This repository has been archived by the owner on Jan 7, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from nikhila05/initial_app
Initial app
- Loading branch information
Showing
30 changed files
with
398 additions
and
44 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
*.pyc | ||
*~ | ||
dist | ||
build | ||
django_webpacker.egg-info/ | ||
sample_project/node_modules/ | ||
sample_project/static/webpack_bundles/ |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
language: python | ||
|
||
python: | ||
- "3.4" | ||
|
||
install: | ||
- python setup.py install | ||
- pip install coveralls | ||
|
||
script: | ||
- coverage run --source=testapp sample_project/manage.py test | ||
|
||
after_success: | ||
coveralls |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
include README.rst | ||
recursive-include django_webpacker/management * |
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
Empty file.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
django-webpacker's documentation: | ||
===================================== | ||
|
||
#badges | ||
|
||
Introduction: | ||
============= | ||
|
||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/usr/bin/env python | ||
import os | ||
import sys | ||
|
||
if __name__ == "__main__": | ||
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "sample_project.settings") | ||
try: | ||
from django.core.management import execute_from_command_line | ||
except ImportError: | ||
# The above import may fail for some other reason. Ensure that the | ||
# issue is really that Django is missing to avoid masking other | ||
# exceptions on Python 2. | ||
try: | ||
import django | ||
except ImportError: | ||
raise ImportError( | ||
"Couldn't import Django. Are you sure it's installed and " | ||
"available on your PYTHONPATH environment variable? Did you " | ||
"forget to activate a virtual environment?" | ||
) | ||
raise | ||
execute_from_command_line(sys.argv) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
{ | ||
"name": "sample_project", | ||
"version": "1.0.0", | ||
"description": "", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
}, | ||
"author": "", | ||
"license": "ISC", | ||
"devDependencies": { | ||
"babel": "^6.23.0", | ||
"babel-core": "^6.24.0", | ||
"babel-loader": "^6.4.1", | ||
"css-loader": "^0.28.0", | ||
"extract-text-webpack-plugin": "^2.1.0", | ||
"file-loader": "^0.11.1", | ||
"html-webpack-inline-source-plugin": "0.0.7", | ||
"html-webpack-plugin": "^2.28.0", | ||
"image-webpack-loader": "^3.3.0", | ||
"less-loader": "^4.0.3", | ||
"node-sass": "^4.5.2", | ||
"react": "^15.4.2", | ||
"react-hot-loader": "^1.3.1", | ||
"sass-loader": "^6.0.3", | ||
"script-loader": "^0.7.0", | ||
"style-loader": "^0.16.1", | ||
"webpack": "^2.3.3", | ||
"webpack-bundle-tracker": "^0.2.0", | ||
"webpack-dev-server": "^2.4.2" | ||
}, | ||
"dependencies": { | ||
"imports-loader": "^0.7.1", | ||
"jquery": "^3.2.1" | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
boto==2.46.1 | ||
Django==1.9.13 | ||
django-webpacker==0.1.1 |
Empty file.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
import os | ||
|
||
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) | ||
|
||
|
||
SECRET_KEY = '8&=h22)%v2_ii66p30-6=3_v%(&ujs83q=l1@m^fd6#t&00tr&' | ||
|
||
DEBUG = True | ||
|
||
ALLOWED_HOSTS = [] | ||
|
||
|
||
|
||
INSTALLED_APPS = [ | ||
'django.contrib.admin', | ||
'django.contrib.auth', | ||
'django.contrib.contenttypes', | ||
'django.contrib.sessions', | ||
'django.contrib.messages', | ||
'django.contrib.staticfiles', | ||
'django_webpacker', | ||
] | ||
|
||
MIDDLEWARE = [ | ||
'django.middleware.security.SecurityMiddleware', | ||
'django.contrib.sessions.middleware.SessionMiddleware', | ||
'django.middleware.common.CommonMiddleware', | ||
'django.middleware.csrf.CsrfViewMiddleware', | ||
'django.contrib.auth.middleware.AuthenticationMiddleware', | ||
'django.contrib.messages.middleware.MessageMiddleware', | ||
'django.middleware.clickjacking.XFrameOptionsMiddleware', | ||
] | ||
|
||
ROOT_URLCONF = 'sample_project.urls' | ||
|
||
TEMPLATES = [ | ||
{ | ||
'BACKEND': 'django.template.backends.django.DjangoTemplates', | ||
'DIRS': [], | ||
'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', | ||
], | ||
}, | ||
}, | ||
] | ||
|
||
WSGI_APPLICATION = 'sample_project.wsgi.application' | ||
|
||
|
||
DATABASES = { | ||
'default': { | ||
'ENGINE': 'django.db.backends.sqlite3', | ||
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), | ||
} | ||
} | ||
|
||
STATIC_URL = '/static/' | ||
|
||
|
||
STATIC_URL = '/static/' | ||
|
||
STATICFILES_DIRS = (BASE_DIR + '/static',) | ||
|
||
|
||
STATICFILES_FINDERS = ( | ||
'django.contrib.staticfiles.finders.FileSystemFinder', | ||
'django.contrib.staticfiles.finders.AppDirectoriesFinder', | ||
# other finders.. | ||
) | ||
|
||
WEB_PACK_FILES = [ | ||
{'html_file_name': 'templates/index.html', | ||
'webpack_js': 'index', | ||
}, | ||
{'html_file_name': 'templates/login.html', | ||
'webpack_js': 'login', | ||
}, | ||
] | ||
|
||
ENABLE_DJANGO_WEBPACK_S3_STORAGES = False | ||
AWS_BUCKET_NAME = '' |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
"""sample_project URL Configuration | ||
The `urlpatterns` list routes URLs to views. For more information please see: | ||
https://docs.djangoproject.com/en/1.10/topics/http/urls/ | ||
Examples: | ||
Function views | ||
1. Add an import: from my_app import views | ||
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') | ||
Class-based views | ||
1. Add an import: from other_app.views import Home | ||
2. Add a URL to urlpatterns: url(r'^$', Home.as_view(), name='home') | ||
Including another URLconf | ||
1. Import the include() function: from django.conf.urls import url, include | ||
2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls')) | ||
""" | ||
from django.conf.urls import url | ||
from django.contrib import admin | ||
from testapp.views import * | ||
|
||
urlpatterns = [ | ||
url(r'^admin/', admin.site.urls), | ||
url(r'^$', index), | ||
url(r'^login/$', login_page, name="login_page"), | ||
] |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
""" | ||
WSGI config for sample_project project. | ||
It exposes the WSGI callable as a module-level variable named ``application``. | ||
For more information on this file, see | ||
https://docs.djangoproject.com/en/1.10/howto/deployment/wsgi/ | ||
""" | ||
|
||
import os | ||
|
||
from django.core.wsgi import get_wsgi_application | ||
|
||
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "sample_project.settings") | ||
|
||
application = get_wsgi_application() |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
body{ | ||
color: #ddd; | ||
} | ||
a{ | ||
color: blue; | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
body{ | ||
color: #ddd; | ||
} | ||
a{ | ||
color: red; | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
$('#login').click(function(e){ | ||
alert("click on login 123") | ||
}) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
$('#hello_world').click(function(e){ | ||
alert("click on hello world 123") | ||
}) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>Hello</title> | ||
<link rel="stylesheet" type="text/css" href="/static/webpack_bundles/index-eae3e24342216ce07d17.css" id="packer_css"/> | ||
</head> | ||
<body> | ||
<a id="hello_world">Hello world</a> | ||
<script id="packer_js" src="/static/webpack_bundles/index-eae3e24342216ce07d17.js" type="text/javascript"></script> | ||
</body> | ||
</html> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>Hello</title> | ||
<link rel="stylesheet" type="text/css" href="/static/webpack_bundles/login-eae3e24342216ce07d17.css" id="packer_css"/> | ||
</head> | ||
<body> | ||
<a id="login">login</a> | ||
<script id="packer_js" src="/static/webpack_bundles/login-eae3e24342216ce07d17.js" type="text/javascript"></script> | ||
</body> | ||
</html> |
Empty file.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
from django.apps import AppConfig | ||
|
||
|
||
class TestappConfig(AppConfig): | ||
name = 'testapp' |
Empty file.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
from django.core.management import call_command | ||
from django.test import TestCase | ||
|
||
|
||
class CommandsTestCase(TestCase): | ||
def test_mycommand(self): | ||
" Test my custom command." | ||
|
||
args = [] | ||
opts = {} | ||
call_command('compress_css_js_files', *args, **opts) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
from django.shortcuts import render | ||
|
||
# Create your views here. | ||
|
||
def index(request): | ||
return render(request, 'index.html') | ||
|
||
|
||
def login_page(request): | ||
return render(request, 'login.html') |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"status":"done","chunks":{"index":[{"name":"index-eae3e24342216ce07d17.js","path":"/home/nikhila/mp_projs/django_packer/django_web_packer/sample_project/static/webpack_bundles/index-eae3e24342216ce07d17.js"},{"name":"index-eae3e24342216ce07d17.css","path":"/home/nikhila/mp_projs/django_packer/django_web_packer/sample_project/static/webpack_bundles/index-eae3e24342216ce07d17.css"}],"login":[{"name":"login-eae3e24342216ce07d17.js","path":"/home/nikhila/mp_projs/django_packer/django_web_packer/sample_project/static/webpack_bundles/login-eae3e24342216ce07d17.js"},{"name":"login-eae3e24342216ce07d17.css","path":"/home/nikhila/mp_projs/django_packer/django_web_packer/sample_project/static/webpack_bundles/login-eae3e24342216ce07d17.css"}]}} |
Oops, something went wrong.