Move templates and manage.py into authentic2 module directory

This commit is contained in:
Benjamin Dauvergne 2011-02-10 22:56:45 +01:00
parent 303c5a98fb
commit 5c08178d7e
46 changed files with 14 additions and 6 deletions

View File

@ -1,11 +1,11 @@
#!/usr/bin/env python
from django.core.management import execute_manager
try:
import authentic2.settings # Assumed to be in the same directory.
import settings # Assumed to be in the same directory.
except ImportError:
import sys
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__)
sys.exit(1)
if __name__ == "__main__":
execute_manager(authentic2.settings)
execute_manager(settings)

View File

@ -16,17 +16,16 @@ ADMINS = (
MANAGERS = ADMINS
_DATABASE_NAME = os.path.join(_PROJECT_PATH, 'authentic.db')
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': _DATABASE_NAME,
'NAME': 'authentic.db',
}
}
#session cookie parameters
SESSION_EXPIRE_AT_BROWSER_CLOSE = True
SESSION_COOKIE_AGE = 36000
SESSION_COOKIE_AGE = 36000 # one day of work
# Local time zone for this installation. Choices can be found here:
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
@ -103,7 +102,8 @@ MIDDLEWARE_CLASSES = (
ROOT_URLCONF = 'authentic2.urls'
TEMPLATE_DIRS = (
os.path.join(_PROJECT_PATH, 'templates'),
# authentic2/templates
os.path.join(os.path.dirname(__file__), 'templates'),
)
INSTALLED_APPS = (

View File

@ -5,6 +5,13 @@
# It started as a copy of ReviewBoard setup.py file, thanks to them, and for
import distutils.core
import authentic2
import os
def ls_R(directory):
'''Recursively list files in @directory'''
for root, dirs, files in os.walk(directory):
for file in files:
yield os.path.join(root, file)
# Build the authentic package.
distutils.core.setup(name="authentic2",
@ -38,6 +45,7 @@ distutils.core.setup(name="authentic2",
'authentic2/vendor/totp_js',],
package_data={ '': ['fixtures/*.json',
'templates/*.html','templates/*/*.html','js/*.js'] },
data_files=[('/share/authentic2/media/', list(ls_R('media')))],
requires=[
'django (>=1.2.0)',
'registration (>=0.7)',