Fakultas Ilmu Komputer UI

Commit d66f17a3 authored by Zamil Majdy's avatar Zamil Majdy
Browse files

Initial commit

\ No newline at end of file
# How To Build
* Node + Npm
* Python + Pip
####In two commands
`git clone https://gitlab.com/PPL2017csui/PPLA1.git kape && cd kape && rm -drf .git && git init && npm install && pip install -r requirements.txt && npm run webpack`
`python manage.py runserver`
Detailed :
* `git clone https://gitlab.com/PPL2017csui/PPLA1.git kape`
* `cd kape`
* `npm install`
* `pip install -r requirements.txt`
* `npm run webpack`
* `python manage.py runserver`
For Windows you need to run `npm run webpack` and `python manage.py runserver` in different terminal.
###Migrate the database
`python manage.py migrate`
Now go to localhost:8000 and you'll see the App running!
This project uses [Django Webpack Loader](https://github.com/owais/django-webpack-loader).
import React from 'react'
function Home() {
return (
<div className="container">
<div className="row">
<div className="col-md-2"></div>
<div className="well col-md-8">
<h1 className="center">Yuk develop KaPe :)</h1>
<div className="col-md-2"></div>
export default Home
import React from 'react';
import Home from './app';
import ReactDOM from 'react-dom';
import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider';
const App = () => (
<Home />
ReactDOM.render( <App />, document.getElementById('react-app'))
from django.contrib import admin
# Register your models here.
from django.apps import AppConfig
class CoreConfig(AppConfig):
name = 'core'
from django.db import models
# Create your models here.
This diff is collapsed.
html, body{
padding: 0;
height: auto;
width: auto;
text-align: center;
{% load render_bundle from webpack_loader %}
{% load static from staticfiles %}
<!DOCTYPE html>
<meta charset="UTF-8">
<title>Django React Awesome App</title>
<link rel="stylesheet" href="{% static 'css/custom.css' %}">
<link rel="stylesheet" href="{% static 'css/bootstrap.min.css' %}">
<div id="react-app"></div>
{% render_bundle 'main' %}
from django.test import TestCase
# Create your tests here.
from django.conf.urls import url
from core import views
urlpatterns = [
url(r'', views.index, name="index"),
from django.shortcuts import render
# Create your views here.
def index(request):
return render(request, 'core/index.html')
File added
import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
os.path.join(BASE_DIR, 'assets'), # We do this so that django's collectstatic copies or our bundles to the STATIC_ROOT or syncs them to whatever storage we use.
'BUNDLE_DIR_NAME': 'bundles/',
'STATS_FILE': os.path.join(BASE_DIR, 'webpack-stats.json'),
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'gz!k*@!n8h$yny1)zp!e5#w8!s4%*wqnur5$qnr@$*xx_o+aij'
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
# Application definition
ROOT_URLCONF = 'kape.urls'
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [],
'APP_DIRS': True,
'context_processors': [
WSGI_APPLICATION = 'kape.wsgi.application'
# Database
# https://docs.djangoproject.com/en/1.10/ref/settings/#databases
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
# Password validation
# https://docs.djangoproject.com/en/1.10/ref/settings/#auth-password-validators
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
# Internationalization
# https://docs.djangoproject.com/en/1.10/topics/i18n/
USE_I18N = True
USE_L10N = True
USE_TZ = True
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.10/howto/static-files/
STATIC_URL = '/static/'
"""djangoreact URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
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, include
from django.contrib import admin
urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'', include('core.urls')),
WSGI config for djangoreact project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "kape.settings")
application = get_wsgi_application()
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment