diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..bc56ebf --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +*.swp +*.pyc +.idea +venv diff --git a/manage.py b/manage.py new file mode 100755 index 0000000..d2424f6 --- /dev/null +++ b/manage.py @@ -0,0 +1,10 @@ +#!/usr/bin/env python +import os +import sys + +if __name__ == "__main__": + os.environ.setdefault("DJANGO_SETTINGS_MODULE", "pfrsite.settings") + + from django.core.management import execute_from_command_line + + execute_from_command_line(sys.argv) diff --git a/pfrsite/__init__.py b/pfrsite/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/pfrsite/settings.py b/pfrsite/settings.py new file mode 100644 index 0000000..44c0001 --- /dev/null +++ b/pfrsite/settings.py @@ -0,0 +1,83 @@ +""" +Django settings for pfrsite project. + +For more information on this file, see +https://docs.djangoproject.com/en/1.7/topics/settings/ + +For the full list of settings and their values, see +https://docs.djangoproject.com/en/1.7/ref/settings/ +""" + +# Build paths inside the project like this: os.path.join(BASE_DIR, ...) +import os +BASE_DIR = os.path.dirname(os.path.dirname(__file__)) + + +# Quick-start development settings - unsuitable for production +# See https://docs.djangoproject.com/en/1.7/howto/deployment/checklist/ + +# SECURITY WARNING: keep the secret key used in production secret! +SECRET_KEY = 'hlaf#yma(8s!cy-bf5e6kc&_5n_l1h!34c(j32-b3v8o7pg$5n' + +# SECURITY WARNING: don't run with debug turned on in production! +DEBUG = True + +TEMPLATE_DEBUG = True + +ALLOWED_HOSTS = [] + + +# Application definition + +INSTALLED_APPS = ( + 'django.contrib.admin', + 'django.contrib.auth', + 'django.contrib.contenttypes', + 'django.contrib.sessions', + 'django.contrib.messages', + 'django.contrib.staticfiles', +) + +MIDDLEWARE_CLASSES = ( + 'django.contrib.sessions.middleware.SessionMiddleware', + 'django.middleware.common.CommonMiddleware', + 'django.middleware.csrf.CsrfViewMiddleware', + 'django.contrib.auth.middleware.AuthenticationMiddleware', + 'django.contrib.auth.middleware.SessionAuthenticationMiddleware', + 'django.contrib.messages.middleware.MessageMiddleware', + 'django.middleware.clickjacking.XFrameOptionsMiddleware', +) + +ROOT_URLCONF = 'pfrsite.urls' + +WSGI_APPLICATION = 'pfrsite.wsgi.application' + + +# Database +# https://docs.djangoproject.com/en/1.7/ref/settings/#databases + +DATABASES = { + 'default': { + 'ENGINE': 'django.db.backends.sqlite3', + 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), + } +} + +# Internationalization +# https://docs.djangoproject.com/en/1.7/topics/i18n/ + +LANGUAGE_CODE = 'en-us' + +TIME_ZONE = 'UTC' + +USE_I18N = True + +USE_L10N = True + +USE_TZ = True + + +# Static files (CSS, JavaScript, Images) +# https://docs.djangoproject.com/en/1.7/howto/static-files/ + +STATIC_URL = '/static/' diff --git a/pfrsite/urls.py b/pfrsite/urls.py new file mode 100644 index 0000000..dec5c09 --- /dev/null +++ b/pfrsite/urls.py @@ -0,0 +1,10 @@ +from django.conf.urls import patterns, include, url +from django.contrib import admin + +urlpatterns = patterns('', + # Examples: + # url(r'^$', 'pfrsite.views.home', name='home'), + # url(r'^blog/', include('blog.urls')), + + url(r'^admin/', include(admin.site.urls)), +) diff --git a/pfrsite/wsgi.py b/pfrsite/wsgi.py new file mode 100644 index 0000000..29e0a42 --- /dev/null +++ b/pfrsite/wsgi.py @@ -0,0 +1,14 @@ +""" +WSGI config for pfrsite project. + +It exposes the WSGI callable as a module-level variable named ``application``. + +For more information on this file, see +https://docs.djangoproject.com/en/1.7/howto/deployment/wsgi/ +""" + +import os +os.environ.setdefault("DJANGO_SETTINGS_MODULE", "pfrsite.settings") + +from django.core.wsgi import get_wsgi_application +application = get_wsgi_application() diff --git a/postfixrest/__init__.py b/postfixrest/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/postfixrest/admin.py b/postfixrest/admin.py new file mode 100644 index 0000000..8c38f3f --- /dev/null +++ b/postfixrest/admin.py @@ -0,0 +1,3 @@ +from django.contrib import admin + +# Register your models here. diff --git a/postfixrest/migrations/__init__.py b/postfixrest/migrations/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/postfixrest/models.py b/postfixrest/models.py new file mode 100644 index 0000000..0f0cd3d --- /dev/null +++ b/postfixrest/models.py @@ -0,0 +1,9 @@ +from django.db import models + + +#TODO: Domain, User + +class Alias(models.Model): + active = models.BooleanField(default=True) + src = models.EmailField() + # TODO: dst EmailListField \ No newline at end of file diff --git a/postfixrest/tests.py b/postfixrest/tests.py new file mode 100644 index 0000000..7ce503c --- /dev/null +++ b/postfixrest/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/postfixrest/views.py b/postfixrest/views.py new file mode 100644 index 0000000..91ea44a --- /dev/null +++ b/postfixrest/views.py @@ -0,0 +1,3 @@ +from django.shortcuts import render + +# Create your views here. diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..7da5c48 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,4 @@ +Django>=1.7,<1.8 +django-extensions==1.4.0 +djangorestframework==2.4.3 +