Heeeeel klein opzetje voor members app

parent 1bae30f6
......@@ -8,6 +8,7 @@
/tourtodo/settings/site.py
.idea/
.tox/
db.sqlite3
# rope
.ropeproject/
This diff was suppressed by a .gitattributes entry.
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-06-29 22:09+0000\n"
"PO-Revision-Date: 2016-06-30 00:13+0200\n"
"Language: nl\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"Last-Translator: Thom Wiggers <thom@thomwiggers.nl>\n"
"Language-Team: \n"
"X-Generator: Poedit 1.8.7.1\n"
#: thaliawebsite/leden/models.py:16
msgid "Benefactor"
msgstr "Begunstiger"
#: thaliawebsite/leden/models.py:17
msgid "Member"
msgstr "Lid"
#: thaliawebsite/leden/models.py:18
msgid "Honorary Member"
msgstr "Erelid"
#: thaliawebsite/settings.py:125
msgid "English"
msgstr "Engels"
#: thaliawebsite/settings.py:126
msgid "Dutch"
msgstr "Nederlands"
from django.contrib import admin
# Register your models here.
from django.apps import AppConfig
class LedenConfig(AppConfig):
name = 'leden'
from django.db import models
from django.conf import settings
from django.utils.translation import ugettext_lazy as _
class Membership(models.Model):
"""This class describes membership data"""
user = models.ForeignKey(
settings.AUTH_USER_MODEL,
on_delete=models.CASCADE,
)
membership_type = models.CharField(
max_length=40,
choices=(('benefactor', _('Benefactor')),
('member', _('Member')),
('honorary', _('Honorary Member'))),
)
from django.test import TestCase
# Create your tests here.
from django.conf.urls import url
from . import views
urlpatterns = [
url('^', views.index),
]
from django.shortcuts import render
def index(request):
return render(request, 'members/index.html')
Templates voor de hele site
===========================
Let op: deze map is voor templates die op de *hele* site van toepassing zijn,
niet alleen voor templates die alleen maar voor één app zijn.
Ook kan deze map gebruikt worden voor admin templates overriden.
<!doctype html>
<html>
<head>
<title>Login</title>
</head>
<body>
<form method="POST">
{% csrf_token %}
{{ form }}
<input type="submit">
</form>
{{ next }}
</body>
</html>
......@@ -11,6 +11,7 @@ https://docs.djangoproject.com/en/dev/ref/settings/
"""
import os
from django.utils.translation import ugettext_lazy as _
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
......@@ -37,6 +38,8 @@ INSTALLED_APPS = [
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
# Our apps
'members',
]
MIDDLEWARE = [
......@@ -55,7 +58,7 @@ ROOT_URLCONF = 'thaliawebsite.urls'
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [],
'DIRS': [os.path.join(BASE_DIR, 'templates')],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
......@@ -110,7 +113,7 @@ AUTH_PASSWORD_VALIDATORS = [
LANGUAGE_CODE = 'en-gb'
TIME_ZONE = 'UTC'
TIME_ZONE = 'Europe/Amsterdam'
USE_I18N = True
......@@ -118,6 +121,13 @@ USE_L10N = True
USE_TZ = True
LANGUAGES = [
('en', _('English')),
('nl', _('Dutch'))
]
LOCALE_PATHS = [os.path.join(BASE_DIR, 'locale')]
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/dev/howto/static-files/
......
......@@ -13,9 +13,13 @@ 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 django.conf.urls import url, include
from django.contrib import admin
urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'^members/', include('members.urls')),
# Default login helpers
url(r'^', include('django.contrib.auth.urls')),
]
Markdown is supported
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