├── .gitignore ├── AUTHORS ├── README.rst ├── doc ├── HELP.mdml └── virtualhost.cfg └── simple_project ├── .epio-app ├── __init__.py ├── apps ├── __init__.py └── core │ ├── __init__.py │ ├── admin.py │ ├── models.py │ ├── templates │ └── index.html │ ├── tests.py │ ├── utils.py │ └── views.py ├── db └── simple-project.db ├── django.wsgi ├── epio.ini ├── manage.py ├── media └── css │ └── base.css ├── requirements.txt ├── settings.py ├── templates ├── base.html └── home.html └── urls.py /.gitignore: -------------------------------------------------------------------------------- 1 | .project 2 | .pydevproject 3 | .settings/ 4 | *.pyc 5 | -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | Current or previous core committers: 2 | 3 | * Darii Denis 4 | 5 | Contributors (in alphabetical order): 6 | 7 | * ... comming soon ... -------------------------------------------------------------------------------- /README.rst: -------------------------------------------------------------------------------- 1 | ============ 2 | Presentation 3 | ============ 4 | simple_project folder here, is a django project. This project has no practical use, it's for learning purpose only. 5 | 6 | 7 | ******* 8 | Documentation 9 | ******* 10 | go here: 11 | `wiki `_. 12 | 13 | ******* 14 | Getting Help 15 | ******* 16 | Please head over to django's IRC channel, #django, on irc.freenode.net 17 | 18 | ******* 19 | Credits 20 | ******* 21 | * python - 22 | `Python Programming Language `_. 23 | * django - 24 | `high-level Python Web framework `_. -------------------------------------------------------------------------------- /doc/HELP.mdml: -------------------------------------------------------------------------------- 1 | You can find this HELP on-line here: https://github.com/DNX/django-simple-project/wiki 2 | 3 | # Generate a random password 4 | You can find this piece of code in real project here: [simple_project](https://github.com/DNX/django-simple-project/blob/master/simple_project/) 5 | 6 | All needed modifications you can find in this commit: 7 | 1. [1e3c24ea...](https://github.com/DNX/django-simple-project/commit/1e3c24eafe3a914c28cb49f0d764f0e264264d83) 8 | 9 | Put this code in your _.py_ file: 10 | ```python 11 | def gen_passwd(length=8, chars=string.letters + string.digits): 12 | return ''.join([choice(chars) for i in range(length)]) 13 | ``` 14 | 15 | 16 | 17 | # Add your applications in separate folder in django project 18 | 19 | You can find this piece of code in real project here: [simple_project/settings.py line 10](https://github.com/DNX/django-simple-project/blob/1c4d89af0f06f6d3d626c671fdfd3bf76c454994/simple_project/settings.py#L10) 20 | 21 | All needed modifications you can find in this commit: 22 | 1. [1c4d89a...](https://github.com/DNX/django-simple-project/commit/1c4d89af0f06f6d3d626c671fdfd3bf76c454994) 23 | 24 | Put this code in your _settings.py_: 25 | ```python 26 | sys.path.append(os.path.join(PROJECT_PATH, 'apps/')) 27 | ``` 28 | > Don't forget to define PROJECT_PATH first 29 | 30 | 31 | 32 | # How check if user exists in Django? 33 | 34 | You can find this piece of code in real project here: [simple_project](https://github.com/DNX/django-simple-project/blob/master/simple_project/) 35 | 36 | All needed modifications you can find in this commit: 37 | 1. [0cd40036...](https://github.com/DNX/django-simple-project/commit/0cd40036eacf553a801a8dc0993198dd721baa3c) 38 | 39 | Put this code in your _.py_ file: 40 | ```python 41 | from django.contrib.auth.models import User 42 | def username_present(username): 43 | if User.objects.filter(username=username).count(): 44 | return True 45 | 46 | return False 47 | ``` 48 | 49 | 50 | 51 | # zzz_Sample_Page (just a sample, leave at the end of this file) 52 | 53 | You can find this piece of code in real project here: [simple_project](https://github.com/DNX/django-simple-project/blob/master/simple_project/) 54 | 55 | All needed modifications you can find in this commit: 56 | 1. [xxxxxxx...](https://github.com/) 57 | 58 | Put this code in your _settings.py_: 59 | ```python 60 | pass 61 | ``` 62 | > Don't forget... -------------------------------------------------------------------------------- /doc/virtualhost.cfg: -------------------------------------------------------------------------------- 1 | 2 | ServerAdmin my_username@example.com 3 | ServerName example.com 4 | ServerAlias www.example.com 5 | 6 | WSGIScriptAlias / /home/user/projects/production/simple_project/django.wsgi 7 | 8 | alias /favicon.ico /home/user/projects/production/simple_project/media/favicon.ico 9 | 10 | 11 | SetHandler default 12 | 13 | alias /media/ /home/user/projects/production/simple_project/media/ 14 | 15 | 16 | SetHandler default 17 | 18 | alias /static/ /home/user/projects/production/simple_project/static/ 19 | 20 | ErrorLog /var/log/apache2/error_example.com.log 21 | LogLevel warn 22 | CustomLog /var/log/apache2/access_example.com.log combined 23 | ServerSignature On 24 | 25 | -------------------------------------------------------------------------------- /simple_project/.epio-app: -------------------------------------------------------------------------------- 1 | project 2 | -------------------------------------------------------------------------------- /simple_project/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DNX/django-simple-project/df72d5822ef655cc4c8854c5c484f464cb25cb90/simple_project/__init__.py -------------------------------------------------------------------------------- /simple_project/apps/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DNX/django-simple-project/df72d5822ef655cc4c8854c5c484f464cb25cb90/simple_project/apps/__init__.py -------------------------------------------------------------------------------- /simple_project/apps/core/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DNX/django-simple-project/df72d5822ef655cc4c8854c5c484f464cb25cb90/simple_project/apps/core/__init__.py -------------------------------------------------------------------------------- /simple_project/apps/core/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | from core.models import * 3 | 4 | class MessageAdmin(admin.ModelAdmin): 5 | def save_model(self, request, obj, form, change): 6 | """ 7 | Automatically fill in the user field on creation. 8 | """ 9 | if not change: 10 | obj.user = request.user 11 | super(self.__class__, self).save_model(request, obj, form, change) 12 | 13 | admin.site.register(Message, MessageAdmin) -------------------------------------------------------------------------------- /simple_project/apps/core/models.py: -------------------------------------------------------------------------------- 1 | from django.db import models 2 | from django.contrib.auth.models import User 3 | 4 | class Message(models.Model): 5 | message = models.TextField() 6 | user = models.ForeignKey(User, editable=False) 7 | 8 | def __unicode__(self): 9 | return self.message -------------------------------------------------------------------------------- /simple_project/apps/core/templates/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | {{ message }} 5 | 6 | 7 |

{{ message }}

8 | 9 | -------------------------------------------------------------------------------- /simple_project/apps/core/tests.py: -------------------------------------------------------------------------------- 1 | """ 2 | This file demonstrates writing tests using the unittest module. These will pass 3 | when you run "manage.py test". 4 | 5 | Replace this with more appropriate tests for your application. 6 | """ 7 | 8 | from django.test import TestCase 9 | 10 | 11 | class SimpleTest(TestCase): 12 | def test_basic_addition(self): 13 | """ 14 | Tests that 1 + 1 always equals 2. 15 | """ 16 | self.assertEqual(1 + 1, 2) 17 | -------------------------------------------------------------------------------- /simple_project/apps/core/utils.py: -------------------------------------------------------------------------------- 1 | from django.contrib.auth.models import User 2 | 3 | """ 4 | Generate a random password. 5 | Code from http://code.activestate.com/recipes/59873-random-password-generation/ 6 | """ 7 | def gen_passwd(length=8, chars=string.letters + string.digits): 8 | return ''.join([choice(chars) for i in range(length)]) 9 | 10 | def username_present(username): 11 | if User.objects.filter(username=username).count(): 12 | return True 13 | 14 | return False -------------------------------------------------------------------------------- /simple_project/apps/core/views.py: -------------------------------------------------------------------------------- 1 | from django.shortcuts import render_to_response 2 | 3 | def index(request): 4 | return render_to_response("index.html", { 5 | "message": "Hello, world! This is django-simple-project!", 6 | }) -------------------------------------------------------------------------------- /simple_project/db/simple-project.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DNX/django-simple-project/df72d5822ef655cc4c8854c5c484f464cb25cb90/simple_project/db/simple-project.db -------------------------------------------------------------------------------- /simple_project/django.wsgi: -------------------------------------------------------------------------------- 1 | import os 2 | import sys 3 | 4 | os.environ['DJANGO_SETTINGS_MODULE'] = 'simple_project.settings' 5 | sys.path.insert(0, '/home/user/projects/production') 6 | sys.path.insert(0, '/home/user/projects/production/simple_project') 7 | 8 | # This has to be done here otherwise Django won't be in a directory 9 | # that's in PYTHONPATH. 10 | from django.core.handlers.wsgi import WSGIHandler 11 | 12 | application = WSGIHandler() -------------------------------------------------------------------------------- /simple_project/epio.ini: -------------------------------------------------------------------------------- 1 | # This is an example epio.ini file. 2 | # We suggest you edit it to fit your application's needs. 3 | # Documentation for the options is available at www.ep.io/docs/epioini/ 4 | 5 | # Django root 6 | [django] 7 | base = . 8 | 9 | [checkout] 10 | directory_name = simple_project 11 | 12 | [services] 13 | postgres = true 14 | 15 | [static] 16 | /media/admin = ../shortcuts/django-admin-media/ 17 | 18 | [wsgi] 19 | 20 | # Location of your requirements file 21 | requirements = requirements.txt 22 | 23 | 24 | [static] 25 | 26 | # Serve the static directory directly as /static 27 | # /static = static 28 | 29 | 30 | [services] 31 | 32 | # Uncomment to enable the PostgreSQL service. 33 | # postgres = true 34 | 35 | # Uncomment to enable the Redis service 36 | # redis = true 37 | 38 | 39 | [checkout] 40 | 41 | # By default your code is put in a directory called 'app'. 42 | # You can change that here. 43 | # directory_name = my_project 44 | 45 | 46 | [env] 47 | 48 | # Set any additional environment variables here. For example: 49 | # IN_PRODUCTION = true 50 | 51 | 52 | [symlinks] 53 | 54 | # Any symlinks you'd like to add. As an example, link 'config.py' to 'configs/epio.py' 55 | # config.py = configs/epio.py 56 | 57 | 58 | # If you're using Django, you'll want to uncomment some or all of these lines 59 | # [django] 60 | # # Path to your project root, relative to this directory. 61 | # base = . 62 | # [static] 63 | # # Serve the admin media 64 | # /media = ../shortcuts/django-admin-media/ 65 | # [env] 66 | # # Use a different settings module for ep.io (i.e. with DEBUG=False) 67 | # DJANGO_SETTINGS_MODULE = production_settings 68 | 69 | -------------------------------------------------------------------------------- /simple_project/manage.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | from django.core.management import execute_manager 3 | try: 4 | import settings # Assumed to be in the same directory. 5 | except ImportError: 6 | import sys 7 | sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll have to run django-admin.py, passing it your settings module.\n(If the file settings.py does indeed exist, it's causing an ImportError somehow.)\n" % __file__) 8 | sys.exit(1) 9 | 10 | if __name__ == "__main__": 11 | execute_manager(settings) 12 | -------------------------------------------------------------------------------- /simple_project/media/css/base.css: -------------------------------------------------------------------------------- 1 | @charset "utf-8"; 2 | 3 | html, body, div, p, ul, li, a, img, h1, h2, h3, h4, h5, h6, small, a img, span, form, cite, iframe 4 | { 5 | margin:0; 6 | border:0; 7 | padding:0; 8 | } 9 | 10 | h1, h2, h3, h4, h5, h6 { 11 | color: #000000; 12 | font-weight: normal; 13 | } 14 | 15 | html, input, textarea 16 | { 17 | line-height: 23px; 18 | } 19 | 20 | input, textarea 21 | { 22 | -moz-border-radius:6px 6px 6px 6px; 23 | background:none repeat scroll 0 0 #F8F8F8; 24 | border:2px solid #C6C6C6; 25 | font-size:15px; 26 | margin:3px; 27 | font-size:17px; 28 | color:#585858; 29 | font-family: "Trebuchet MS",Arial,Helvetica,sans-serif; 30 | } 31 | 32 | body { 33 | background-attachment: fixed; 34 | background-color: #fff; 35 | background-position: center top; 36 | background-repeat: no-repeat; 37 | color: #333333; 38 | font-size:16px !important; 39 | line-height: 1.7em; 40 | letter-spacing: 0.03em; 41 | word-spacing:0px; 42 | margin: 0; 43 | padding: 0; 44 | overflow-x:hidden; 45 | } 46 | 47 | a 48 | { 49 | text-decoration:none; 50 | } 51 | 52 | #dsp_bd ul 53 | { 54 | list-style: none outside none; 55 | margin: 20px 0 20px 10px; 56 | padding: 0; 57 | } 58 | 59 | #dsp_bd ul li { 60 | color: #68992A; 61 | margin: 0; 62 | padding: 0 0 5px 20px; 63 | } 64 | 65 | p 66 | { 67 | margin:0 10px 0 10px; 68 | } 69 | 70 | img 71 | { 72 | margin:10px; 73 | } 74 | 75 | img.right 76 | { 77 | clear: right; 78 | float: right; 79 | } 80 | 81 | img.left 82 | { 83 | clear: left; 84 | float: left; 85 | } 86 | 87 | img.right, img.left, img.center 88 | { 89 | background-color: #F7F7F7; 90 | border: 1px solid #6A604F; 91 | color: #666666; 92 | padding: 5px; 93 | margin: 8px 8px; 94 | } 95 | 96 | .bx_hide 97 | { 98 | display: none; /* we show this element with jQuery script at the last moment, after load */ 99 | } 100 | 101 | .dialog_popup { 102 | min-width: 250px; 103 | min-height: 250px; 104 | } 105 | 106 | #dsp_container 107 | { 108 | margin: 0 auto; 109 | padding: 0; 110 | width: 978px; 111 | } 112 | 113 | #dsp_hd 114 | { 115 | height: 120px; 116 | padding: 18px 0 21px; 117 | } 118 | 119 | .dsp_logo 120 | { 121 | background-image: url("/media/images/rule_header.gif"); 122 | background-position: left bottom; 123 | background-repeat: no-repeat; 124 | margin: 0; 125 | padding: 0 0 18px; 126 | } 127 | 128 | .dsp_logo h1{ 129 | background: url("/media/images/logo.png") no-repeat scroll 0 0 transparent; 130 | display: block; 131 | font-size: 1px; 132 | height: 74px; 133 | margin: 0 auto; 134 | width: 195px; 135 | } 136 | 137 | .dsp_logo h1 a{ 138 | background: url("/media/images/logo.png") no-repeat scroll 0 0 transparent; 139 | display: block; 140 | height: 35px; 141 | outline: medium none; 142 | width: 291px; 143 | } 144 | 145 | .dsp_logo a{ 146 | visibility: hidden; 147 | } 148 | 149 | 150 | #dsp_menu 151 | { 152 | background-position: left bottom; 153 | background-repeat: no-repeat; 154 | padding: 4px 0 6px; 155 | text-align: center; 156 | text-transform: uppercase; 157 | } 158 | 159 | #dsp_menu ul { 160 | margin: 0; 161 | padding: 0; 162 | } 163 | 164 | #dsp_menu ul li { 165 | display: inline-block; 166 | margin: 0 0 0 3px; 167 | } 168 | 169 | #dsp_menu ul li.active { 170 | background-position: left top; 171 | background-repeat: no-repeat; 172 | padding: 7px 6px 6px 8px; 173 | width: 104px; 174 | } 175 | 176 | #dsp_menu ul li a { 177 | color: #333333; 178 | } 179 | 180 | #dsp_menu ul li.active a { 181 | color: #FFFFFF; 182 | } 183 | 184 | #dsp_menu ul li a:hover, #dsp_menu ul .current { 185 | color: #000000; 186 | height: 34px; 187 | padding-top: 6px; 188 | } 189 | 190 | .dot 191 | { 192 | color: #FF0000; 193 | padding: 0; 194 | position: relative; 195 | top: -0.3em; 196 | vertical-align: baseline; 197 | } 198 | 199 | #site_title 200 | { 201 | clear: both; 202 | height: 40px; 203 | padding: 30px 20px; 204 | margin: 0; 205 | } 206 | 207 | #site_title h1 { 208 | display: block; 209 | float: left; 210 | margin: 0; 211 | padding: 0; 212 | width: 500px; 213 | } 214 | 215 | #site_title h1 a { 216 | color: #FFFFFF; 217 | font-size: 40px; 218 | font-weight: 400; 219 | outline: medium none; 220 | } 221 | 222 | #site_title h1 a span { 223 | font-size: 14px; 224 | } 225 | 226 | #dsp_bd.content { 227 | clear: both; 228 | padding: 10px 10px 0; 229 | } 230 | 231 | h1.title { 232 | border-bottom: 1px solid #626335; 233 | font-size: 28px; 234 | font-weight: 700; 235 | margin: 0 0 20px; 236 | padding: 5px 0 10px; 237 | } 238 | 239 | .col_w200 { 240 | width: 200px; 241 | } 242 | 243 | .col_w560 { 244 | width: 560px; 245 | } 246 | 247 | .col_w340 { 248 | width: 340px; 249 | } 250 | 251 | .float_l { 252 | float: left; 253 | } 254 | 255 | .float_r { 256 | float: right; 257 | } 258 | 259 | .h30 { 260 | height: 30px; 261 | } 262 | 263 | .cleaner { 264 | clear: both; 265 | } 266 | 267 | a.gototop { 268 | clear: both; 269 | display: block; 270 | float: right; 271 | height: 20px; 272 | color: #333333; 273 | font-size: 13px; 274 | font-weight: 700; 275 | } 276 | 277 | #dsp_ft { 278 | clear: both; 279 | color: #E5EFC8; 280 | padding: 20px; 281 | text-align: center; 282 | font-size: 13px; 283 | } 284 | 285 | #dsp_ft a { 286 | color: #FFFFFF; 287 | } 288 | 289 | .submit 290 | { 291 | border:2px solid #339900; 292 | padding:4px; 293 | margin:5px 30px; 294 | } 295 | 296 | .cancel 297 | { 298 | border:2px solid #CC0033; 299 | padding:4px; 300 | margin:5px 30px; 301 | } 302 | 303 | .errorlist 304 | { 305 | color:#C80000; 306 | font-size:12px; 307 | } 308 | 309 | div.content 310 | { 311 | text-align: left; 312 | } 313 | 314 | .title 315 | { 316 | margin: 20px 30px; 317 | } -------------------------------------------------------------------------------- /simple_project/requirements.txt: -------------------------------------------------------------------------------- 1 | Django>=1.3 2 | -------------------------------------------------------------------------------- /simple_project/settings.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # -*- coding: utf-8 -*- 3 | 4 | # Django settings for simple_project project. 5 | 6 | import os, sys 7 | 8 | PROJECT_PATH = os.path.realpath(os.path.dirname(__file__)) 9 | 10 | sys.path.append(os.path.join(PROJECT_PATH, 'apps/')) 11 | 12 | _ = lambda s: s 13 | 14 | DEBUG = True 15 | TEMPLATE_DEBUG = DEBUG 16 | 17 | ADMINS = ( 18 | ('Darii Denis', 'email@example.com'), 19 | ) 20 | 21 | MANAGERS = ADMINS 22 | 23 | # START email configuration # 24 | EMAIL_USE_TLS = True 25 | EMAIL_HOST = 'smtp.gmail.com' 26 | EMAIL_HOST_USER = 'example@gmail.com' # put your gmail email 27 | EMAIL_HOST_PASSWORD = 'exampleGmailPassword' # put your gmail password 28 | EMAIL_PORT = 587 29 | 30 | EMAIL_SUBJECT_PREFIX = '[Simple Project] ' # personalize this prefix 31 | 32 | SEND_BROKEN_LINK_EMAILS = False 33 | # END email configuration # 34 | 35 | DATABASES = { 36 | 'default': { 37 | 'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. 38 | 'NAME': os.path.join(PROJECT_PATH, 'db/simple-project.db'), # Or path to database file if using sqlite3. 39 | 'USER': '', # Not used with sqlite3. 40 | 'PASSWORD': '', # Not used with sqlite3. 41 | 'HOST': '', # Set to empty string for localhost. Not used with sqlite3. 42 | 'PORT': '', # Set to empty string for default. Not used with sqlite3. 43 | } 44 | } 45 | 46 | # Local time zone for this installation. Choices can be found here: 47 | # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name 48 | # although not all choices may be available on all operating systems. 49 | # On Unix systems, a value of None will cause Django to use the same 50 | # timezone as the operating system. 51 | # If running in a Windows environment this must be set to the same as your 52 | # system time zone. 53 | TIME_ZONE = 'Europe/Rome' 54 | 55 | # Language code for this installation. All choices can be found here: 56 | # http://www.i18nguy.com/unicode/language-identifiers.html 57 | LANGUAGE_CODE = 'en' 58 | 59 | # A tuple of all available languages. 60 | LANGUAGES = ( 61 | ('en', _('English')), 62 | ('it', _('Italian')), 63 | ) 64 | 65 | SITE_ID = 1 66 | 67 | # If you set this to False, Django will make some optimizations so as not 68 | # to load the internationalization machinery. 69 | USE_I18N = True 70 | 71 | # If you set this to False, Django will not format dates, numbers and 72 | # calendars according to the current locale 73 | USE_L10N = True 74 | 75 | # Absolute path to the directory that holds media. 76 | # Example: "/home/media/media.lawrence.com/" 77 | MEDIA_ROOT = os.path.join(PROJECT_PATH, 'media/') 78 | 79 | # URL that handles the media served from MEDIA_ROOT. Make sure to use a 80 | # trailing slash if there is a path component (optional in other cases). 81 | # Examples: "http://media.lawrence.com", "http://example.com/media/" 82 | MEDIA_URL = '/media/' 83 | 84 | # Absolute path to the directory static files should be collected to. 85 | # Don't put anything in this directory yourself; store your static files 86 | # in apps' "static/" subdirectories and in STATICFILES_DIRS. 87 | # Example: "/home/media/media.lawrence.com/static/" 88 | STATIC_ROOT = os.path.join(PROJECT_PATH, 'static/') 89 | 90 | # URL prefix for static files. 91 | # Example: "http://media.lawrence.com/static/" 92 | STATIC_URL = '/static/' 93 | 94 | # URL prefix for admin static files -- CSS, JavaScript and images. 95 | # Make sure to use a trailing slash. 96 | # Examples: "http://foo.com/static/admin/", "/static/admin/". 97 | ADMIN_MEDIA_PREFIX = "%sadmin/" % MEDIA_URL 98 | 99 | # Additional locations of static files 100 | STATICFILES_DIRS = ( 101 | # Put strings here, like "/home/html/static" or "C:/www/django/static". 102 | # Always use forward slashes, even on Windows. 103 | # Don't forget to use absolute paths, not relative paths. 104 | ) 105 | 106 | # List of finder classes that know how to find static files in 107 | # various locations. 108 | STATICFILES_FINDERS = ( 109 | 'django.contrib.staticfiles.finders.FileSystemFinder', 110 | 'django.contrib.staticfiles.finders.AppDirectoriesFinder', 111 | 'django.contrib.staticfiles.finders.DefaultStorageFinder', 112 | ) 113 | 114 | # Make this unique, and don't share it with anybody. 115 | SECRET_KEY = '64vs7!*x90txu77&v!dopq@l$orr&v)uxa4u7ob)))1v&d9s1v' 116 | 117 | # List of callables that know how to import templates from various sources. 118 | TEMPLATE_LOADERS = ( 119 | 'django.template.loaders.filesystem.Loader', 120 | 'django.template.loaders.app_directories.Loader', 121 | # 'django.template.loaders.eggs.Loader', 122 | ) 123 | 124 | MIDDLEWARE_CLASSES = ( 125 | 'django.middleware.common.CommonMiddleware', 126 | 'django.contrib.sessions.middleware.SessionMiddleware', 127 | 'django.middleware.csrf.CsrfViewMiddleware', 128 | 'django.contrib.auth.middleware.AuthenticationMiddleware', 129 | 'django.contrib.messages.middleware.MessageMiddleware', 130 | ) 131 | 132 | ROOT_URLCONF = 'simple_project.urls' 133 | 134 | TEMPLATE_DIRS = ( 135 | os.path.join(PROJECT_PATH, 'templates'), 136 | ) 137 | 138 | INSTALLED_APPS = ( 139 | 'django.contrib.auth', 140 | 'django.contrib.contenttypes', 141 | 'django.contrib.sessions', 142 | 'django.contrib.sites', 143 | 'django.contrib.messages', 144 | 'django.contrib.admin', 145 | 146 | 'core', 147 | ) 148 | 149 | # A sample logging configuration. The only tangible logging 150 | # performed by this configuration is to send an email to 151 | # the site admins on every HTTP 500 error. 152 | # See http://docs.djangoproject.com/en/dev/topics/logging for 153 | # more details on how to customize your logging configuration. 154 | LOGGING = { 155 | 'version': 1, 156 | 'disable_existing_loggers': False, 157 | 'handlers': { 158 | 'mail_admins': { 159 | 'level': 'ERROR', 160 | 'class': 'django.utils.log.AdminEmailHandler' 161 | } 162 | }, 163 | 'loggers': { 164 | 'django.request': { 165 | 'handlers': ['mail_admins'], 166 | 'level': 'ERROR', 167 | 'propagate': True, 168 | }, 169 | } 170 | } -------------------------------------------------------------------------------- /simple_project/templates/base.html: -------------------------------------------------------------------------------- 1 | {% load i18n %} 2 | {% block base %} 3 | {% block doctype %}{% endblock doctype %} 4 | 5 | {% block head %} 6 | 7 | {% block meta %} 8 | 9 | 10 | 11 | {% endblock meta %} 12 | 13 | {% block title %}{% endblock title %} 14 | 15 | 16 | {% block css %} 17 | {% block css.shared %} 18 | 19 | {% endblock css.shared %} 20 | {% block css.custom %}{% endblock css.custom %} 21 | {% endblock css%} 22 | 23 | {% block js %} 24 | {% block js.shared %} 25 | 26 | {% endblock js.shared %} 27 | {% block js.custom %}{% endblock js.custom %} 28 | {% endblock js%} 29 | 30 | {% endblock head %} 31 | 32 | 33 |
34 | {% block header %} 35 | 36 |
37 | 42 |
43 | 50 |
51 |
52 |

DSP on-line portal...

53 |
54 |
    55 |
  • 56 |
  • 57 |
58 |
59 |
60 | {% block header_content %}{% endblock header_content %} 61 |
62 | 63 | {% endblock header %} 64 | 65 | {% block body %} 66 | 67 |
68 | {% block content %}{% endblock content %} 69 |
70 | 71 | {% endblock body %} 72 | 73 | {% block footer %} 74 | 75 |
76 | Copyright © 1998 - 2011 DSP | Powered by Darii Denis | Designed by Plesco Natalia 77 | {% block footer_content %}{% endblock footer_content %} 78 |
79 | 80 | {% endblock footer %} 81 |
82 | {% block ft_js %} 83 | 90 | {% block ft_js.custom %} 91 | {% endblock ft_js.custom %} 92 | {% endblock ft_js %} 93 | 94 | 95 | {% endblock base %} 96 | -------------------------------------------------------------------------------- /simple_project/templates/home.html: -------------------------------------------------------------------------------- 1 | {% extends "base.html" %} 2 | {% load i18n %} 3 | {% block title %}{% trans "Welcome to Simple Django Project!" %}{% endblock title %} 4 | {% block content %} 5 |

Welcome to Simple Django Project!

6 | {% endblock content %} -------------------------------------------------------------------------------- /simple_project/urls.py: -------------------------------------------------------------------------------- 1 | from django.conf.urls.defaults import * 2 | from django.views.generic.simple import direct_to_template 3 | 4 | from django.contrib import admin 5 | admin.autodiscover() 6 | 7 | urlpatterns = patterns('', 8 | # Example: 9 | # (r'^simple_project/', include('simple_project.foo.urls')), 10 | 11 | # Uncomment the admin/doc line below and add 'django.contrib.admindocs' 12 | # to INSTALLED_APPS to enable admin documentation: 13 | # (r'^admin/doc/', include('django.contrib.admindocs.urls')), 14 | 15 | # enable the admin: 16 | (r'^admin/', include(admin.site.urls)), 17 | 18 | url(r'^$', direct_to_template, {'template':'home.html',}, name='home'), 19 | ) 20 | --------------------------------------------------------------------------------