Beginnings of the integrated front-end website.
This commit is contained in:
parent
bb6905c1ca
commit
1e13d94b20
12 changed files with 1258 additions and 2 deletions
0
apps/website/__init__.py
Normal file
0
apps/website/__init__.py
Normal file
3
apps/website/models.py
Normal file
3
apps/website/models.py
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
from django.db import models
|
||||
|
||||
# Create your models here.
|
||||
5
apps/website/urls.py
Normal file
5
apps/website/urls.py
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
from django.conf.urls.defaults import *
|
||||
|
||||
urlpatterns = patterns('apps.website.views',
|
||||
(r'^$', 'page_index'),
|
||||
)
|
||||
29
apps/website/views.py
Normal file
29
apps/website/views.py
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
from django.shortcuts import render_to_response, get_object_or_404
|
||||
from django.db import connection
|
||||
from django.template import RequestContext
|
||||
from django import newforms as forms
|
||||
from django.newforms.util import ValidationError
|
||||
import django.views.generic.list_detail as list_detail
|
||||
from django.contrib.auth.models import User
|
||||
from django.utils import simplejson
|
||||
|
||||
from apps.news.models import NewsEntry
|
||||
|
||||
"""
|
||||
This file contains the generic, assorted views that don't fall under one of
|
||||
the other applications.
|
||||
"""
|
||||
|
||||
def page_index(request):
|
||||
"""
|
||||
Main root page.
|
||||
"""
|
||||
news_entries = NewsEntry.objects.all().order_by('-date_posted')[:2]
|
||||
|
||||
pagevars = {
|
||||
"page_title": "Front Page",
|
||||
"news_entries": news_entries,
|
||||
}
|
||||
|
||||
context_instance = RequestContext(request)
|
||||
return render_to_response('index.html', pagevars, context_instance)
|
||||
10
apps/website/webcontext.py
Normal file
10
apps/website/webcontext.py
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
from django.conf import settings
|
||||
|
||||
def general_context(request):
|
||||
"""
|
||||
Returns common Evennia-related context stuff.
|
||||
"""
|
||||
return {
|
||||
'game_name': "Test Game",
|
||||
'media_url': settings.MEDIA_URL,
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue