Просмотр исходного кода

Some fancy stuff and hopefully new testrunner.

Rafał Pitoń 11 лет назад
Родитель
Сommit
de54e89d73

+ 3 - 1
.travis.yml

@@ -5,5 +5,7 @@ install:
   - pip install -r requirements.txt --use-mirrors
   - pip install coveralls
 script:
-  - coverage run --source=misago testrunner.py test
+  - python setup.py install
+  - misago-start.py testproject
+  - coverage run --source=misago manage.py test
   - coveralls

+ 1 - 1
docs/setup_maintenance.rst

@@ -53,4 +53,4 @@ Lorem ipsum dolor met.
 Growing up with your community
 ==============================
 
-Lorem ipsum dolor met.
+Lorem ipsum dolor met.

+ 3 - 0
misago/conf/defaults.py

@@ -42,6 +42,7 @@ INSTALLED_APPS = (
     'django.contrib.staticfiles',
     'misago.core',
     'misago.conf',
+    'misago.views',
 )
 
 MIDDLEWARE_CLASSES = (
@@ -77,3 +78,5 @@ USE_I18N = True
 USE_L10N = True
 
 USE_TZ = True
+
+TIME_ZONE = 'UTC'

+ 0 - 0
testproject/__init__.py → misago/project_template/cron.txt


+ 1 - 1
testrunner.py → misago/project_template/manage.py

@@ -3,7 +3,7 @@ import os
 import sys
 
 if __name__ == "__main__":
-    os.environ.setdefault("DJANGO_SETTINGS_MODULE", "testproject.settings")
+    os.environ.setdefault("DJANGO_SETTINGS_MODULE", "{{ project_name }}.settings")
 
     from django.core.management import execute_from_command_line
 

+ 0 - 0
misago/project_template/project_name/__init__.py


+ 10 - 12
testproject/settings.py → misago/project_template/project_name/settings.py

@@ -1,11 +1,11 @@
 """
-Django settings for testproject project.
+Misago settings for {{ project_name }} project.
 
 For more information on this file, see
-https://docs.djangoproject.com/en/1.6/topics/settings/
+https://docs.djangoproject.com/en/{{ docs_version }}/topics/settings/
 
 For the full list of settings and their values, see
-https://docs.djangoproject.com/en/1.6/ref/settings/
+https://docs.djangoproject.com/en/{{ docs_version }}/ref/settings/
 """
 
 # Import Misago defaults for overriding
@@ -18,10 +18,10 @@ BASE_DIR = os.path.dirname(os.path.dirname(__file__))
 
 
 # Quick-start development settings - unsuitable for production
-# See https://docs.djangoproject.com/en/1.6/howto/deployment/checklist/
+# See https://docs.djangoproject.com/en/{{ docs_version }}/howto/deployment/checklist/
 
 # SECURITY WARNING: keep the secret key used in production secret!
-SECRET_KEY = 'wxl2=un5q24b&*2&6#&+j)$ou5j&k*sfhjoho1888ths^mq82c'
+SECRET_KEY = '{{ secret_key }}'
 
 # SECURITY WARNING: don't run with debug turned on in production!
 DEBUG = True
@@ -33,13 +33,13 @@ ALLOWED_HOSTS = []
 
 # Application definition
 
-ROOT_URLCONF = 'testproject.urls'
+ROOT_URLCONF = '{{ project_name }}.urls'
 
-WSGI_APPLICATION = 'testproject.wsgi.application'
+WSGI_APPLICATION = '{{ project_name }}.wsgi.application'
 
 
 # Database
-# https://docs.djangoproject.com/en/1.6/ref/settings/#databases
+# https://docs.djangoproject.com/en/{{ docs_version }}/ref/settings/#databases
 
 DATABASES = {
     'default': {
@@ -50,14 +50,12 @@ DATABASES = {
 
 
 # Internationalization
-# https://docs.djangoproject.com/en/1.6/topics/i18n/
+# https://docs.djangoproject.com/en/{{ docs_version }}/topics/i18n/
 
 LANGUAGE_CODE = 'en-us'
 
-TIME_ZONE = 'UTC'
-
 
 # Static files (CSS, JavaScript, Images)
-# https://docs.djangoproject.com/en/1.6/howto/static-files/
+# https://docs.djangoproject.com/en/{{ docs_version }}/howto/static-files/
 
 STATIC_URL = '/static/'

+ 0 - 0
testproject/urls.py → misago/project_template/project_name/urls.py


+ 3 - 3
testproject/wsgi.py → misago/project_template/project_name/wsgi.py

@@ -1,14 +1,14 @@
 """
-WSGI config for testproject project.
+Misago settings for {{ project_name }} 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.6/howto/deployment/wsgi/
+https://docs.djangoproject.com/en/{{ docs_version }}/howto/deployment/wsgi/
 """
 
 import os
-os.environ.setdefault("DJANGO_SETTINGS_MODULE", "testproject.settings")
+os.environ.setdefault("DJANGO_SETTINGS_MODULE", "{{ project_name }}.settings")
 
 from django.core.wsgi import get_wsgi_application
 application = get_wsgi_application()

+ 0 - 0
requirements.txt → misago/project_template/requirements.txt


+ 6 - 1
setup.py

@@ -5,9 +5,10 @@ from misago import __version__ as version
 
 README = open(os.path.join(os.path.dirname(__file__), 'README.rst')).read()
 
-with open("requirements.txt", "r") as f:
+with open(os.path.join(os.path.dirname(__file__), 'misago/project_template/requirements.txt'), "r") as f:
     REQUIREMENTS = [x.strip() for x in f.readlines()]
 
+
 # allow setup.py to be run from any path
 os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
 
@@ -24,6 +25,10 @@ setup(
     author=u'Rafał Pitoń',
     author_email='kontakt@rpiton.com',
     install_requires=REQUIREMENTS,
+    scripts=['misago/bin/misago-start.py'],
+    entry_points={'console_scripts': [
+        'misago-start = misago.bin.misago-start.start_misago_project',
+    ]},
     classifiers=[
         'Development Status :: 2 - Pre-Alpha',
         'Environment :: Web Environment',