Skip to content
Snippets Groups Projects
Commit ab271381 authored by Jacek Lebioda's avatar Jacek Lebioda
Browse files

Basic web application

parent 64a54191
No related branches found
No related tags found
No related merge requests found
...@@ -62,34 +62,6 @@ TEMPLATES = [ ...@@ -62,34 +62,6 @@ TEMPLATES = [
}, },
] ]
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = '@u6t&w7yw&i!dcrm97y1bg*pt9e@s240dc@*b6d9_#b^bqr%+^'
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
WSGI_APPLICATION = 'smash.wsgi.application'
# Database
# https://docs.djangoproject.com/en/1.10/ref/settings/#databases
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'smashdb',
'PASSWORD': '---',
'HOST': 'localhost',
'PORT': '' # '' === default one
# If to use sqlite
# 'ENGINE': 'django.db.backends.sqlite3',
# 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
}
}
# Password validation # Password validation
# https://docs.djangoproject.com/en/1.10/ref/settings/#auth-password-validators # https://docs.djangoproject.com/en/1.10/ref/settings/#auth-password-validators
......
...@@ -13,9 +13,13 @@ Including another URLconf ...@@ -13,9 +13,13 @@ Including another URLconf
1. Import the include() function: from django.conf.urls import url, include 1. Import the include() function: from django.conf.urls import url, include
2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls')) 2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls'))
""" """
from django.conf.urls import url
from django.conf.urls import url, include
from django.contrib import admin from django.contrib import admin
import web.urls
urlpatterns = [ urlpatterns = [
url(r'^admin/', admin.site.urls), url(r'^admin/', admin.site.urls),
url(r'^', include(web.urls))
] ]
{% load static %}
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0"/>
<title>{% block title %}Scheduling system{% endblock title %}</title>
{% block styles %}
<!-- links rel=stylesheet here -->
{% endblock styles %}
</head>
<body>
{% block content %}
{% endblock content %}
{% block footer %}
{% endblock footer %}
{% block scripts %}
<script src="https://code.jquery.com/jquery-2.1.1.min.js"></script>
{% endblock scripts %}
</body>
</html>
{% extends "_base.html" %}
{% block content %}
<h3>Smart scheduling</h3>
{% endblock content %}
"""smash 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 web import views
urlpatterns = [
url(r'$', views.index)
]
from django.shortcuts import render from django.shortcuts import render
from django.http import HttpResponse
from django.template import loader
# Create your views here. # Create your views here.
def index(request):
template = loader.get_template("index.html")
return HttpResponse(template.render({}), request)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment