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 import super_cool.bewsito.views as view from config import ApplicationConfig import django urlpatterns = [ url(r'^bewsito/', view.mainpage), url(r'^js/(?P<path>.*)$', django.views.static.serve, {'document_root': ApplicationConfig.get_source('js')}, name='JS'), url(r'^css/(?P<path>.*)$', django.views.static.serve, {'document_root': ApplicationConfig.get_source('css')}, name='CSS'), url(r'^images/(?P<path>.*)$', django.views.static.serve, {'document_root': ApplicationConfig.get_source('image')}, name='IMG'), ]
Generated by 'django-admin startproject' using Django 1.9.2. For more information on this file, see https://docs.djangoproject.com/en/1.9/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.9/ref/settings/ """ import os from config import ApplicationConfig # Build paths inside the project like this: os.path.join(BASE_DIR, ...) BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) HTML_DIR = ApplicationConfig.get_source('html') # Quick-start development settings - unsuitable for production # See https://docs.djangoproject.com/en/1.9/howto/deployment/checklist/ # SECURITY WARNING: keep the secret key used in production secret! SECRET_KEY = '(dr96^@b_8vt741o5oyn3__j7*l0cxv!_t=z_69u8j31oc4r2=' # SECURITY WARNING: don't run with debug turned on in production! DEBUG = True ALLOWED_HOSTS = [] # Application definition INSTALLED_APPS = [
Generated by 'django-admin startproject' using Django 1.9.2. For more information on this file, see https://docs.djangoproject.com/en/1.9/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.9/ref/settings/ """ import os from config import ApplicationConfig # Build paths inside the project like this: os.path.join(BASE_DIR, ...) BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) HTML_DIR = ApplicationConfig.get_source('html') # Quick-start development settings - unsuitable for production # See https://docs.djangoproject.com/en/1.9/howto/deployment/checklist/ # SECURITY WARNING: keep the secret key used in production secret! SECRET_KEY = '(dr96^@b_8vt741o5oyn3__j7*l0cxv!_t=z_69u8j31oc4r2=' # SECURITY WARNING: don't run with debug turned on in production! DEBUG = True ALLOWED_HOSTS = [] # Application definition
The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.9/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 import super_cool.bewsito.views as view from config import ApplicationConfig import django urlpatterns = [ url(r'^bewsito/', view.mainpage), url(r'^js/(?P<path>.*)$', django.views.static.serve, {'document_root': ApplicationConfig.get_source('js')}, name='JS'), url(r'^css/(?P<path>.*)$', django.views.static.serve, {'document_root': ApplicationConfig.get_source('css')}, name='CSS'), url(r'^images/(?P<path>.*)$', django.views.static.serve, {'document_root': ApplicationConfig.get_source('image')}, name='IMG'), ]