start fix error, update pkg version

feature/docker
Dmitriy Shesterkin 9 years ago
parent b0511b2ed5
commit 88d3aff6e9
  1. 5
      project/__init__.py
  2. 23
      project/_celery.py
  3. 8
      project/callback/urls.py
  4. 23
      project/celery.py
  5. 3
      project/customer/__init__.py
  6. 6
      project/customer/apps.py
  7. 4
      project/customer/forms.py
  8. 2
      project/customer/middleware.py
  9. 2
      project/customer/models.py
  10. 82
      project/customer/urls.py
  11. 8
      project/customer/views/clients_ajax.py
  12. 4
      project/customer/views/documents.py
  13. 8
      project/customer/views/license.py
  14. 6
      project/customer/views/profile.py
  15. 8
      project/customer/views/profile_ajax.py
  16. 1
      project/docs/__init__.py
  17. 4
      project/docs/as_xls/render_to_xls.py
  18. 2
      project/docs/autocomplete_light_registry.py
  19. 6
      project/docs/filters.py
  20. 16
      project/docs/forms/__init__.py
  21. 4
      project/docs/forms/aktrabot.py
  22. 4
      project/docs/forms/aktsverki.py
  23. 6
      project/docs/forms/base_forms.py
  24. 4
      project/docs/forms/dover.py
  25. 12
      project/docs/forms/faktura.py
  26. 8
      project/docs/forms/invoice.py
  27. 4
      project/docs/forms/nakladn.py
  28. 3
      project/docs/forms/platejka.py
  29. 16
      project/docs/models/__init__.py
  30. 6
      project/docs/models/aktrabot.py
  31. 4
      project/docs/models/aktsverki.py
  32. 8
      project/docs/models/base_models.py
  33. 2
      project/docs/models/dover.py
  34. 12
      project/docs/models/faktura.py
  35. 6
      project/docs/models/invoice.py
  36. 4
      project/docs/models/mixins.py
  37. 6
      project/docs/models/nakladn.py
  38. 6
      project/docs/models/platejka.py
  39. 4
      project/docs/urls.py
  40. 16
      project/docs/views/__init__.py
  41. 18
      project/docs/views/base_views.py
  42. 10
      project/docs/views/invoice.py
  43. 3
      project/myauth/__init__.py
  44. 7
      project/myauth/apps.py
  45. 8
      project/myauth/emails.py
  46. 1
      project/myauth/forms.py
  47. 4
      project/myauth/models.py
  48. 4
      project/myauth/views.py
  49. 151
      project/settings.py
  50. 10
      project/urls.py

@ -1,4 +1,5 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from __future__ import absolute_import from __future__ import absolute_import
#from .celery import app as celery_app # from .celery import app as celery_app
#
# __all__ = ['celery_app']

@ -1,23 +0,0 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import os
from django.conf import settings
# set the default Django settings module for the 'celery' program.
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'project.settings')
import celery
from celery import Celery
app = Celery('proj')
# Using a string here means the worker will not have to
# pickle the object when using Windows.
app.config_from_object('django.conf:settings')
app.autodiscover_tasks(lambda: settings.INSTALLED_APPS)
#@app.task(bind=True)
#def debug_task(self):
# print('Request: {0!r}'.format(self.request))

@ -1,8 +1,8 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from django.conf.urls.defaults import patterns, url from django.conf.urls import patterns, url
from .views import req_avail from .views import req_avail
urlpatterns = patterns('', urlpatterns = patterns('',
url(r'^send/$', req_avail, name='callback-send-message'), url(r'^send/$', req_avail, name='callback-send-message'),
url(r'^send/(?P<id>\d+)/$', req_avail, name='callback-request-item'), url(r'^send/(?P<id>\d+)/$', req_avail, name='callback-request-item'),
) )

@ -0,0 +1,23 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
import os
import celery
print celery.__file__
# from celery import Celery
from django.conf import settings
# set the default Django settings module for the 'celery' program.
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'project.settings')
# app = Celery('proj')
# Using a string here means the worker will not have to
# pickle the object when using Windows.
# app.config_from_object('django.conf:settings')
# app.autodiscover_tasks(lambda: settings.INSTALLED_APPS)
# @app.task(bind=True)
# def debug_task(self):
# print('Request: {0!r}'.format(self.request))

@ -1,2 +1,3 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from .models import get_profile # from customer.models import get_profile
default_app_config = "customer.apps.CustomerConfig"

@ -0,0 +1,6 @@
# -*- coding: utf-8 -*-
from django.apps import AppConfig
class CustomerConfig(AppConfig):
name = 'customer'

@ -7,7 +7,7 @@ from django.conf import settings
from yandex_money.forms import PaymentForm from yandex_money.forms import PaymentForm
from project.commons.forms import MyBaseModelForm, set_field_error from project.commons.forms import MyBaseModelForm, set_field_error
from . import consts, models from customer import consts, models
FILE_UPLOAD_MAX_MEMORY_SIZE = getattr(settings, 'FILE_UPLOAD_MAX_MEMORY_SIZE ', 2621440) # default 2.5Mb FILE_UPLOAD_MAX_MEMORY_SIZE = getattr(settings, 'FILE_UPLOAD_MAX_MEMORY_SIZE ', 2621440) # default 2.5Mb
@ -59,6 +59,7 @@ class UserProfileForm(MyBaseModelForm):
class Meta: class Meta:
model = models.UserProfile model = models.UserProfile
fields = "__all__"
def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):
super(UserProfileForm, self).__init__(*args, **kwargs) super(UserProfileForm, self).__init__(*args, **kwargs)
@ -276,6 +277,7 @@ class UserProfileFiltersForm(MyBaseModelForm):
widgets = { widgets = {
'bank_account': forms.RadioSelect(), 'bank_account': forms.RadioSelect(),
} }
fields = "__all__"
def __init__(self, profile=None, accounts=None, *args, **kwargs): def __init__(self, profile=None, accounts=None, *args, **kwargs):
instance = kwargs.get('instance') instance = kwargs.get('instance')

@ -3,7 +3,7 @@ from django.utils.functional import SimpleLazyObject
from django.contrib.auth.views import logout as django_logout from django.contrib.auth.views import logout as django_logout
from django.contrib import messages from django.contrib import messages
from .models import get_profile from customer.models import get_profile
def _get_profile(request): def _get_profile(request):

@ -12,7 +12,7 @@ from django.db.models import Max
from django.core.urlresolvers import reverse from django.core.urlresolvers import reverse
from . import consts, managers, utils from . import consts, managers, utils
from project.myauth.models import DokUser from myauth.models import DokUser
from project.commons.utils import only_numerics from project.commons.utils import only_numerics

@ -1,63 +1,63 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from django.conf.urls import * from django.conf.urls import *
from . import views from customer import views
from .views import profile, profile_ajax, license, docs from customer.views import profile, profile_ajax, license, documents
from .views import bank_accounts,bank_accounts_ajax from customer.views import bank_accounts, bank_accounts_ajax
from .views import clients, clients_ajax from customer.views import clients, clients_ajax
urlpatterns = patterns('', urlpatterns = patterns('',
# личный кабинет # личный кабинет
url(r'^$', views.customer_index, name='customer_index'), url(r'^$', views.customer_index, name='customer_index'),
# --- профиль # --- профиль
url(r'^profile/$', profile.profile_view, name='customer_profile_view'), url(r'^profile/$', profile.profile_view, name='customer_profile_view'),
url(r'^profile/edit/$', profile.profile_edit, name='customer_profile_edit'), url(r'^profile/edit/$', profile.profile_edit, name='customer_profile_edit'),
url(r'^profile/email/$', profile.profile_email, name='customer_profile_email'), url(r'^profile/email/$', profile.profile_email, name='customer_profile_email'),
url(r'^license/$', license.order_license, name='customer_order_license'), url(r'^license/$', license.order_license, name='customer_order_license'),
url(r'^delete_license/(?P<pk>\d+)/$', license.delete_license, name='customer_delete_license'), url(r'^delete_license/(?P<pk>\d+)/$', license.delete_license, name='customer_delete_license'),
url(r'^get_doc/(?P<order_num>\d+)/$', docs.get_doc, name='customer_license_get_doc'), url(r'^get_doc/(?P<order_num>\d+)/$', documents.get_doc, name='customer_license_get_doc'),
url(r'^payment/confirm/(?P<payment_id>\d+)$', license.yandex_pay, name='yamoney_confirm'), url(r'^payment/confirm/(?P<payment_id>\d+)$', license.yandex_pay, name='yamoney_confirm'),
url(r'^payment/result/$', license.payment_result, name='yamoney_result'), url(r'^payment/result/$', license.payment_result, name='yamoney_result'),
url(r'^payment/success/$', license.payment_success, name='yamoney_success'), url(r'^payment/success/$', license.payment_success, name='yamoney_success'),
url(r'^payment/fail/$', license.payment_fail, name='yamoney_fail'), url(r'^payment/fail/$', license.payment_fail, name='yamoney_fail'),
url(r'^license_list/$', license.license_list, name='customer_license_list'), url(r'^license_list/$', license.license_list, name='customer_license_list'),
url(r'^paid_list/$', license.paid_list, name='customer_paid_list'), url(r'^paid_list/$', license.paid_list, name='customer_paid_list'),
# --- профиль AJAX # --- профиль AJAX
url(r'^profile/filters/edit/ajax/$', profile_ajax.profile_filters_edit_ajax, name='customer_profile_filters_edit_ajax'), url(r'^profile/filters/edit/ajax/$', profile_ajax.profile_filters_edit_ajax, name='customer_profile_filters_edit_ajax'),
url(r'^profile/email/ajax/$', profile_ajax.profile_email_ajax, name='customer_profile_email_ajax'), url(r'^profile/email/ajax/$', profile_ajax.profile_email_ajax, name='customer_profile_email_ajax'),
# --- расчетные счета # --- расчетные счета
url(r'^bank-accounts/$', bank_accounts.bank_accounts_list, name='customer_bank_accounts_list'), url(r'^bank-accounts/$', bank_accounts.bank_accounts_list, name='customer_bank_accounts_list'),
url(r'^bank-accounts/page/(?P<page_num>[0-9]+)/$', bank_accounts.bank_accounts_list, name='customer_bank_accounts_list'), url(r'^bank-accounts/page/(?P<page_num>[0-9]+)/$', bank_accounts.bank_accounts_list, name='customer_bank_accounts_list'),
url(r'^bank-accounts/add/$', bank_accounts.bank_accounts_add, name='customer_bank_accounts_add'), url(r'^bank-accounts/add/$', bank_accounts.bank_accounts_add, name='customer_bank_accounts_add'),
url(r'^bank-accounts/(?P<id>\d+)/edit/$', bank_accounts.bank_accounts_edit, name='customer_bank_accounts_edit'), url(r'^bank-accounts/(?P<id>\d+)/edit/$', bank_accounts.bank_accounts_edit, name='customer_bank_accounts_edit'),
url(r'^bank-accounts/(?P<id>\d+)/delete/$', bank_accounts.bank_accounts_delete, name='customer_bank_accounts_delete'), url(r'^bank-accounts/(?P<id>\d+)/delete/$', bank_accounts.bank_accounts_delete, name='customer_bank_accounts_delete'),
# --- расчетные счета AJAX # --- расчетные счета AJAX
url(r'^bank-accounts/ajax/$', bank_accounts_ajax.bank_accounts_list_ajax, name='customer_bank_accounts_list_ajax'), url(r'^bank-accounts/ajax/$', bank_accounts_ajax.bank_accounts_list_ajax, name='customer_bank_accounts_list_ajax'),
url(r'^bank-accounts/(?P<id>\d+)/get/ajax/$', bank_accounts_ajax.bank_accounts_get_ajax, url(r'^bank-accounts/(?P<id>\d+)/get/ajax/$', bank_accounts_ajax.bank_accounts_get_ajax,
name='customer_bank_accounts_get_ajax'), name='customer_bank_accounts_get_ajax'),
url(r'^bank-accounts/add/ajax/$', bank_accounts_ajax.bank_accounts_add_ajax, name='customer_bank_accounts_add_ajax'), url(r'^bank-accounts/add/ajax/$', bank_accounts_ajax.bank_accounts_add_ajax, name='customer_bank_accounts_add_ajax'),
url(r'^bank-accounts/(?P<id>\d+)/edit/ajax/$', bank_accounts_ajax.bank_accounts_edit_ajax, url(r'^bank-accounts/(?P<id>\d+)/edit/ajax/$', bank_accounts_ajax.bank_accounts_edit_ajax,
name='customer_bank_accounts_edit_ajax'), name='customer_bank_accounts_edit_ajax'),
url(r'^bank-accounts/(?P<id>\d+)/delete/ajax/$', bank_accounts_ajax.bank_accounts_delete_ajax, url(r'^bank-accounts/(?P<id>\d+)/delete/ajax/$', bank_accounts_ajax.bank_accounts_delete_ajax,
name='customer_bank_accounts_delete_ajax'), name='customer_bank_accounts_delete_ajax'),
# --- контрагенты # --- контрагенты
url(r'^clients/$', clients.clients_list, name='customer_clients_list'), url(r'^clients/$', clients.clients_list, name='customer_clients_list'),
url(r'^clients/page/(?P<page_num>[0-9]+)/$', clients.clients_list, name='customer_clients_list'), url(r'^clients/page/(?P<page_num>[0-9]+)/$', clients.clients_list, name='customer_clients_list'),
url(r'^clients/add/$', clients.clients_add, name='customer_clients_add'), url(r'^clients/add/$', clients.clients_add, name='customer_clients_add'),
url(r'^clients/(?P<id>\d+)/edit/$', clients.clients_edit, name='customer_clients_edit'), url(r'^clients/(?P<id>\d+)/edit/$', clients.clients_edit, name='customer_clients_edit'),
url(r'^clients/(?P<id>\d+)/delete/$', clients.clients_delete, name='customer_clients_delete'), url(r'^clients/(?P<id>\d+)/delete/$', clients.clients_delete, name='customer_clients_delete'),
# --- контрагенты AJAX # --- контрагенты AJAX
url(r'^clients/(?P<id>\d+)/get/ajax/$', clients_ajax.clients_get_ajax, name='customer_clients_get_ajax'), url(r'^clients/(?P<id>\d+)/get/ajax/$', clients_ajax.clients_get_ajax, name='customer_clients_get_ajax'),
url(r'^clients/add/ajax/$', clients_ajax.clients_add_ajax, name='customer_clients_add_ajax'), url(r'^clients/add/ajax/$', clients_ajax.clients_add_ajax, name='customer_clients_add_ajax'),
url(r'^clients/(?P<id>\d+)/edit/ajax/$', clients_ajax.clients_edit_ajax, name='customer_clients_edit_ajax'), url(r'^clients/(?P<id>\d+)/edit/ajax/$', clients_ajax.clients_edit_ajax, name='customer_clients_edit_ajax'),
url(r'^clients/(?P<id>\d+)/delete/ajax/$', clients_ajax.clients_delete_ajax, name='customer_clients_delete_ajax'), url(r'^clients/(?P<id>\d+)/delete/ajax/$', clients_ajax.clients_delete_ajax, name='customer_clients_delete_ajax'),
url(r'^tmp_upload/ajax/$', profile.tmp_upload, name='upload_tmp_file'), url(r'^tmp_upload/ajax/$', profile.tmp_upload, name='upload_tmp_file'),
) )

@ -9,10 +9,10 @@ from django.views.decorators.csrf import csrf_protect
from django.contrib.auth.decorators import login_required from django.contrib.auth.decorators import login_required
from django.template.loader import render_to_string from django.template.loader import render_to_string
from .. import models, forms from customer import models, forms
from ...docs.models import Invoice, Faktura, AktRabot, AktSverki, Nakladn, Platejka, Dover from docs.models import Invoice, Faktura, AktRabot, AktSverki, Nakladn, Platejka, Dover
from ..decorators import license_required from customer.decorators import license_required
from ..utils import raise_if_no_profile from customer.utils import raise_if_no_profile
@login_required @login_required

@ -10,8 +10,8 @@ from xlrd import open_workbook
from xlutils.copy import copy from xlutils.copy import copy
from pytils.numeral import rubles from pytils.numeral import rubles
from ..models import License from customer.models import License
from ..utils import raise_if_no_profile from customer.utils import raise_if_no_profile
XLS_ROOT = os.path.join(settings.TEMPLATE_DIRS[0], 'xls') XLS_ROOT = os.path.join(settings.TEMPLATE_DIRS[0], 'xls')

@ -14,10 +14,10 @@ from django.views.decorators.csrf import csrf_protect
from yandex_money.models import Payment from yandex_money.models import Payment
from ..models import License, LicensePrice from customer.models import License, LicensePrice
from ..consts import PAYFORMS from customer.consts import PAYFORMS
from ..forms import LicenseForm, YaForm from customer.forms import LicenseForm, YaForm
from ..utils import raise_if_no_profile from customer.utils import raise_if_no_profile
@login_required @login_required

@ -19,9 +19,9 @@ from easy_thumbnails.files import get_thumbnailer
from project.commons.pdf_tools import render_pdf_to_string, pdf_to_response from project.commons.pdf_tools import render_pdf_to_string, pdf_to_response
from .. import models, forms from customer import models, forms
from ..decorators import license_required from customer.decorators import license_required
from ..utils import raise_if_no_profile from customer.utils import raise_if_no_profile
PDF_PROFILE_NAME = u'Реквизиты.pdf' PDF_PROFILE_NAME = u'Реквизиты.pdf'

@ -7,11 +7,11 @@ from django.views.decorators.http import require_POST
from django.views.decorators.csrf import csrf_protect from django.views.decorators.csrf import csrf_protect
from django.contrib.auth.decorators import login_required from django.contrib.auth.decorators import login_required
from .. import models, forms from customer import models, forms
from ..decorators import license_required from customer.decorators import license_required
from .profile import _send_profile_email, _profile_get_pdf from customer.views.profile import _send_profile_email, _profile_get_pdf
from ..utils import raise_if_no_profile from customer.utils import raise_if_no_profile
@login_required @login_required

@ -0,0 +1 @@
# -*- coding: utf-8 -*-

@ -8,8 +8,8 @@ import xlrd
import xlwt import xlwt
from django.conf import settings from django.conf import settings
from django.template import (Template, RequestContext, BLOCK_TAG_START, BLOCK_TAG_END, from django.template import Template, RequestContext
VARIABLE_TAG_START, VARIABLE_TAG_END) from django.template.base import BLOCK_TAG_START, BLOCK_TAG_END, VARIABLE_TAG_START, VARIABLE_TAG_END
from project.commons.xls import (get_xlwt_style_list, copy_cells, width_cols, horz_page_break, mm_to_twips, from project.commons.xls import (get_xlwt_style_list, copy_cells, width_cols, horz_page_break, mm_to_twips,
sum_src_heights, sum_dst_heights) sum_src_heights, sum_dst_heights)

@ -3,7 +3,7 @@ import autocomplete_light
from django.db.models import Q from django.db.models import Q
from models import (Country, Currency, Measure) from models import (Country, Currency, Measure)
from project.customer.models import Client from customer.models import Client
class AutocompleteWithEmptyWidget(autocomplete_light.AutocompleteModelBase): class AutocompleteWithEmptyWidget(autocomplete_light.AutocompleteModelBase):

@ -3,10 +3,10 @@ import datetime
import django_filters import django_filters
from project.customer.models import Client from customer.models import Client
from .models import Invoice from docs.models import Invoice
from . import consts from docs import consts
class CustomDateRangeFilter(django_filters.DateRangeFilter): class CustomDateRangeFilter(django_filters.DateRangeFilter):

@ -1,9 +1,9 @@
from .email import EmailForm from docs.forms.email import EmailForm
from .invoice import InvoiceForm, InvoiceAdminForm, InvoiceItemForm, InvoiceItemAdminForm, InvoicesListForm from docs.forms.invoice import InvoiceForm, InvoiceAdminForm, InvoiceItemForm, InvoiceItemAdminForm, InvoicesListForm
from .aktrabot import AktRabotForm, AktRabotAdminForm, AktRabotItemForm, AktRabotItemAdminForm from docs.forms.aktrabot import AktRabotForm, AktRabotAdminForm, AktRabotItemForm, AktRabotItemAdminForm
from .aktsverki import AktSverkiForm, AktSverkiAdminForm, AktSverkiItemForm, AktSverkiItemAdminForm from docs.forms.aktsverki import AktSverkiForm, AktSverkiAdminForm, AktSverkiItemForm, AktSverkiItemAdminForm
from .dover import DoverForm, DoverAdminForm, DoverItemForm, DoverItemAdminForm from docs.forms.dover import DoverForm, DoverAdminForm, DoverItemForm, DoverItemAdminForm
from .platejka import PlatejkaForm, PlatejkaAdminForm from docs.forms.platejka import PlatejkaForm, PlatejkaAdminForm
from .nakladn import NakladnForm, NakladnAdminForm, NakladnItemForm, NakladnItemAdminForm from docs.forms.nakladn import NakladnForm, NakladnAdminForm, NakladnItemForm, NakladnItemAdminForm
from .faktura import FakturaForm, FakturaAdminForm, FakturaItemForm, FakturaItemAdminForm from docs.forms.faktura import FakturaForm, FakturaAdminForm, FakturaItemForm, FakturaItemAdminForm

@ -26,7 +26,8 @@ class AktRabotForm(BaseModelForm):
class AktRabotAdminForm(AktRabotForm): class AktRabotAdminForm(AktRabotForm):
"""Форма редактирования акта выполн. работ - для админки.""" """Форма редактирования акта выполн. работ - для админки."""
class Meta(AktRabotForm.Meta): class Meta(AktRabotForm.Meta):
fields = None # fields = None
exclude = ()
_textarea = forms.Textarea(attrs={'cols': 80, 'rows': 3}) _textarea = forms.Textarea(attrs={'cols': 80, 'rows': 3})
widgets = { widgets = {
'doc_text': _textarea, 'doc_text': _textarea,
@ -42,6 +43,7 @@ class AktRabotItemForm(MyBaseModelForm):
class Meta: class Meta:
model = AktRabotItem model = AktRabotItem
exclude = ['parent'] exclude = ['parent']
fields ='__all__'
class AktRabotItemAdminForm(AktRabotItemForm): class AktRabotItemAdminForm(AktRabotItemForm):

@ -40,7 +40,8 @@ class AktSverkiAdminForm(AktSverkiForm):
} }
class Meta(AktSverkiForm.Meta): class Meta(AktSverkiForm.Meta):
fields = None # fields = None
exclude = ()
def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):
# обязательно нужно вызывать родительский __init__ и передавать ему None вместо user - иначе глюки ! # обязательно нужно вызывать родительский __init__ и передавать ему None вместо user - иначе глюки !
@ -52,6 +53,7 @@ class AktSverkiItemForm(MyBaseModelForm):
class Meta: class Meta:
model = AktSverkiItem model = AktSverkiItem
exclude = ['parent'] exclude = ['parent']
fields = '__all__'
class AktSverkiItemAdminForm(AktSverkiItemForm): class AktSverkiItemAdminForm(AktSverkiItemForm):

@ -2,9 +2,9 @@
from django.forms import ModelChoiceField from django.forms import ModelChoiceField
import autocomplete_light import autocomplete_light
from project.commons.forms import MyBaseModelForm from commons.forms import MyBaseModelForm
from project.customer.models import BankAccount, Client from customer.models import BankAccount, Client
from project.docs.models import Invoice from docs.models import Invoice
class BaseModelForm(MyBaseModelForm): class BaseModelForm(MyBaseModelForm):

@ -34,7 +34,8 @@ class DoverForm(BaseModelForm):
class DoverAdminForm(DoverForm): class DoverAdminForm(DoverForm):
"""Форма редактирования доверенности на получение ТМЦ - для админки.""" """Форма редактирования доверенности на получение ТМЦ - для админки."""
class Meta(DoverForm.Meta): class Meta(DoverForm.Meta):
fields = None # fields = None
exclude = ()
def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):
# обязательно нужно вызывать родительский __init__ и передавать ему None вместо user - иначе глюки ! # обязательно нужно вызывать родительский __init__ и передавать ему None вместо user - иначе глюки !
@ -46,6 +47,7 @@ class DoverItemForm(MyBaseModelForm):
class Meta: class Meta:
model = DoverItem model = DoverItem
exclude = ['parent'] exclude = ['parent']
fields = '__all__'
class DoverItemAdminForm(DoverItemForm): class DoverItemAdminForm(DoverItemForm):

@ -3,10 +3,10 @@ from django import forms
import autocomplete_light import autocomplete_light
from project.commons.forms import MyBaseModelForm from commons.forms import MyBaseModelForm
from .base_forms import BaseModelForm from docs.forms.base_forms import BaseModelForm
from ..models import Faktura, FakturaItem from docs.models import Faktura, FakturaItem
from project.customer.models import Client from customer.models import Client
class FakturaForm(BaseModelForm): class FakturaForm(BaseModelForm):
@ -38,7 +38,8 @@ class FakturaForm(BaseModelForm):
class FakturaAdminForm(FakturaForm): class FakturaAdminForm(FakturaForm):
"""Форма редактирования фактуры - для админки.""" """Форма редактирования фактуры - для админки."""
class Meta(FakturaForm.Meta): class Meta(FakturaForm.Meta):
fields = None # fields = None
exclude = ()
_textarea = forms.Textarea(attrs={'cols': 80, 'rows': 3}) _textarea = forms.Textarea(attrs={'cols': 80, 'rows': 3})
widgets = { widgets = {
'doc_text': _textarea, 'doc_text': _textarea,
@ -55,6 +56,7 @@ class FakturaItemForm(MyBaseModelForm):
class Meta: class Meta:
model = FakturaItem model = FakturaItem
exclude = ['parent'] exclude = ['parent']
fields = '__all__'
class FakturaItemAdminForm(FakturaItemForm): class FakturaItemAdminForm(FakturaItemForm):

@ -3,8 +3,8 @@ from django import forms
from project.commons.forms import MyBaseModelForm from project.commons.forms import MyBaseModelForm
from .base_forms import BaseModelForm from docs.forms.base_forms import BaseModelForm
from ..models import Invoice, InvoiceItem from docs.models import Invoice, InvoiceItem
class InvoiceForm(BaseModelForm): class InvoiceForm(BaseModelForm):
@ -26,7 +26,8 @@ class InvoiceForm(BaseModelForm):
class InvoiceAdminForm(InvoiceForm): class InvoiceAdminForm(InvoiceForm):
"""Форма редактирования счета - для админки.""" """Форма редактирования счета - для админки."""
class Meta(InvoiceForm.Meta): class Meta(InvoiceForm.Meta):
fields = None # fields = None
exclude = ()
_textarea = forms.Textarea(attrs={'cols': 80, 'rows': 3}) _textarea = forms.Textarea(attrs={'cols': 80, 'rows': 3})
widgets = { widgets = {
'doc_text': _textarea, 'doc_text': _textarea,
@ -51,6 +52,7 @@ class InvoiceItemForm(MyBaseModelForm):
class Meta: class Meta:
model = InvoiceItem model = InvoiceItem
exclude = ['parent'] exclude = ['parent']
fields = '__all__'
class InvoiceItemAdminForm(InvoiceItemForm): class InvoiceItemAdminForm(InvoiceItemForm):

@ -27,7 +27,8 @@ class NakladnForm(BaseModelForm):
class NakladnAdminForm(NakladnForm): class NakladnAdminForm(NakladnForm):
"""Форма редактирования накладной - для админки.""" """Форма редактирования накладной - для админки."""
class Meta(NakladnForm.Meta): class Meta(NakladnForm.Meta):
fields = None # fields = None
exclude = ()
_textarea = forms.Textarea(attrs={'cols': 80, 'rows': 3}) _textarea = forms.Textarea(attrs={'cols': 80, 'rows': 3})
widgets = { widgets = {
'doc_text': _textarea, 'doc_text': _textarea,
@ -43,6 +44,7 @@ class NakladnItemForm(MyBaseModelForm):
class Meta: class Meta:
model = NakladnItem model = NakladnItem
exclude = ['parent'] exclude = ['parent']
fields = '__all__'
class NakladnItemAdminForm(NakladnItemForm): class NakladnItemAdminForm(NakladnItemForm):

@ -69,7 +69,8 @@ class PlatejkaForm(BaseModelForm):
class PlatejkaAdminForm(PlatejkaForm): class PlatejkaAdminForm(PlatejkaForm):
"""Форма редактирования платежного поручения - для админки.""" """Форма редактирования платежного поручения - для админки."""
class Meta(PlatejkaForm.Meta): class Meta(PlatejkaForm.Meta):
fields = None # fields = None
exclude = ()
widgets = { widgets = {
'doc_info': forms.Textarea(attrs={'cols': 80, 'rows': 5}), 'doc_info': forms.Textarea(attrs={'cols': 80, 'rows': 5}),
} }

@ -1,8 +1,8 @@
from .refs import Currency, Country, Measure from docs.models.refs import Currency, Country, Measure
from .invoice import Invoice, InvoiceItem from docs.models.invoice import Invoice, InvoiceItem
from .aktrabot import AktRabot, AktRabotItem from docs.models.aktrabot import AktRabot, AktRabotItem
from .aktsverki import AktSverki, AktSverkiItem from docs.models.aktsverki import AktSverki, AktSverkiItem
from .dover import Dover, DoverItem from docs.models.dover import Dover, DoverItem
from .platejka import Platejka from docs.models.platejka import Platejka
from .nakladn import Nakladn, NakladnItem from docs.models.nakladn import Nakladn, NakladnItem
from .faktura import Faktura, FakturaItem from docs.models.faktura import Faktura, FakturaItem

@ -1,9 +1,9 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from django.db import models from django.db import models
from .base_models import BaseInvoiceModel, BaseItemInvoiceModel from docs.models.base_models import BaseInvoiceModel, BaseItemInvoiceModel
from .mixins import SignedStatusFieldMixin, InvoiceFieldMixin from docs.models.mixins import SignedStatusFieldMixin, InvoiceFieldMixin
from .linked_docs_mixin import LinkedDocsMixin from docs.models.linked_docs_mixin import LinkedDocsMixin
class AktRabot(BaseInvoiceModel, SignedStatusFieldMixin, InvoiceFieldMixin, LinkedDocsMixin): class AktRabot(BaseInvoiceModel, SignedStatusFieldMixin, InvoiceFieldMixin, LinkedDocsMixin):

@ -3,8 +3,8 @@ from decimal import Decimal
from django.db import models from django.db import models
from .base_models import BaseModel, VeryBaseModel from docs.models.base_models import BaseModel, VeryBaseModel
from .mixins import SignedStatusFieldMixin from docs.models.mixins import SignedStatusFieldMixin
class AktSverki(BaseModel, SignedStatusFieldMixin): class AktSverki(BaseModel, SignedStatusFieldMixin):

@ -2,11 +2,11 @@
from django.db import models from django.db import models
from django.conf import settings from django.conf import settings
from project.customer.models import UserProfile from customer.models import UserProfile
from project.customer.models import Client, BankAccount from customer.models import Client, BankAccount
from . import managers from docs.models import managers
from .. import consts from docs import consts
class VeryBaseModel(models.Model): class VeryBaseModel(models.Model):

@ -1,7 +1,7 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from django.db import models from django.db import models
from .base_models import BaseModel, VeryBaseModel from docs.models.base_models import BaseModel, VeryBaseModel
class Dover(BaseModel): class Dover(BaseModel):

@ -1,11 +1,11 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from django.db import models from django.db import models
from project.customer.models import Client from customer.models import Client
from .base_models import BaseInvoiceModel, BaseItemInvoiceModel from docs.models.base_models import BaseInvoiceModel, BaseItemInvoiceModel
from .refs import Currency, Country, Measure from docs.models.refs import Currency, Country, Measure
from .mixins import SignedStatusFieldMixin, InvoiceFieldMixin from docs.models.mixins import SignedStatusFieldMixin, InvoiceFieldMixin
from .linked_docs_mixin import LinkedDocsMixin from docs.models.linked_docs_mixin import LinkedDocsMixin
class Faktura(BaseInvoiceModel, SignedStatusFieldMixin, InvoiceFieldMixin, LinkedDocsMixin): class Faktura(BaseInvoiceModel, SignedStatusFieldMixin, InvoiceFieldMixin, LinkedDocsMixin):
@ -19,7 +19,7 @@ class Faktura(BaseInvoiceModel, SignedStatusFieldMixin, InvoiceFieldMixin, Linke
receiver = models.ForeignKey(Client, related_name='receiver_fakturas', blank=True, null=True, verbose_name=u'Получатель') receiver = models.ForeignKey(Client, related_name='receiver_fakturas', blank=True, null=True, verbose_name=u'Получатель')
plat_doc_num = models.CharField(u'Номер платёжного документа', max_length=30, blank=True, default='') plat_doc_num = models.CharField(u'Номер платёжного документа', max_length=30, blank=True, default='')
plat_doc_date = models.DateField('Дата платёжного документа', blank=True, null=True) plat_doc_date = models.DateField('Дата платёжного документа', blank=True, null=True)
fix_doc_num = models.PositiveIntegerField(u'Номер исправления', max_length=30, null=True, blank=True) fix_doc_num = models.PositiveIntegerField(u'Номер исправления', null=True, blank=True)
fix_doc_date = models.DateField('Дата исправления', blank=True, null=True) fix_doc_date = models.DateField('Дата исправления', blank=True, null=True)
def get_consignor_and_address(self): def get_consignor_and_address(self):

@ -1,9 +1,9 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from django.db import models from django.db import models
from .base_models import BaseInvoiceModel, BaseItemInvoiceModel from base_models import BaseInvoiceModel, BaseItemInvoiceModel
from .linked_docs_mixin import LinkedDocsMixin from linked_docs_mixin import LinkedDocsMixin
from .. import consts from docs import consts
class Invoice(BaseInvoiceModel, LinkedDocsMixin): class Invoice(BaseInvoiceModel, LinkedDocsMixin):

@ -1,8 +1,8 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from django.db import models from django.db import models
from .invoice import Invoice from docs.models.invoice import Invoice
from .. import consts from docs import consts
class SignedStatusFieldMixin(models.Model): class SignedStatusFieldMixin(models.Model):

@ -1,9 +1,9 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from django.db import models from django.db import models
from .base_models import BaseInvoiceModel, BaseItemInvoiceModel from docs.models.base_models import BaseInvoiceModel, BaseItemInvoiceModel
from .mixins import SignedStatusFieldMixin, InvoiceFieldMixin from docs.models.mixins import SignedStatusFieldMixin, InvoiceFieldMixin
from .linked_docs_mixin import LinkedDocsMixin from docs.models.linked_docs_mixin import LinkedDocsMixin
class Nakladn(BaseInvoiceModel, SignedStatusFieldMixin, InvoiceFieldMixin, LinkedDocsMixin): class Nakladn(BaseInvoiceModel, SignedStatusFieldMixin, InvoiceFieldMixin, LinkedDocsMixin):

@ -1,10 +1,10 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from django.db import models from django.db import models
from project.customer.models import BankAccount from customer.models import BankAccount
from .base_models import BaseModel from docs.models.base_models import BaseModel
from .. import consts from docs import consts
class Platejka(BaseModel): class Platejka(BaseModel):

@ -1,8 +1,8 @@
# -*- coding: UTF-8 -*- # -*- coding: UTF-8 -*-
from django.conf.urls import * from django.conf.urls import *
from .views import (InvoiceViews, AktRabotViews, AktSverkiViews, DoverViews, PlatejkaViews, NakladnViews, FakturaViews) from docs.views import (InvoiceViews, AktRabotViews, AktSverkiViews, DoverViews, PlatejkaViews, NakladnViews, FakturaViews)
from .views import getview, index, get_invoices, get_tbl_items, get_client_by_invoice, toggle_doc_status from docs.views import getview, index, get_invoices, get_tbl_items, get_client_by_invoice, toggle_doc_status
urlpatterns = patterns('docs.views', urlpatterns = patterns('docs.views',

@ -4,14 +4,14 @@ from django.contrib.auth.decorators import login_required
from django.http import Http404 from django.http import Http404
from django.conf import settings from django.conf import settings
from .invoice import InvoiceViews from docs.views.invoice import InvoiceViews
from .aktrabot import AktRabotViews from docs.views.aktrabot import AktRabotViews
from .aktsverki import AktSverkiViews from docs.views.aktsverki import AktSverkiViews
from .dover import DoverViews from docs.views.dover import DoverViews
from .platejka import PlatejkaViews from docs.views.platejka import PlatejkaViews
from .nakladn import NakladnViews from docs.views.nakladn import NakladnViews
from .faktura import FakturaViews from docs.views.faktura import FakturaViews
from .ajax import get_invoices, get_tbl_items, get_client_by_invoice, toggle_doc_status from docs.views.ajax import get_invoices, get_tbl_items, get_client_by_invoice, toggle_doc_status
@login_required # важно!!! @login_required # важно!!!

@ -21,17 +21,17 @@ from django.core.mail import EmailMessage
from django.utils.encoding import smart_str from django.utils.encoding import smart_str
from django.conf import settings from django.conf import settings
from project.commons.utils import dthandler from commons.utils import dthandler
from project.commons.paginator import pagination, save_per_page_value from commons.paginator import pagination, save_per_page_value
from project.commons.pdf_tools import render_pdf_to_string, pdf_to_response from commons.pdf_tools import render_pdf_to_string, pdf_to_response
from project.commons.xls import xls_to_response from commons.xls import xls_to_response
from project.customer.models import get_profile, BankAccount from customer.models import get_profile, BankAccount
from project.customer.forms import ClientsListForm, ClientForm from customer.forms import ClientsListForm, ClientForm
from ..as_xls import render_xls_to_string from docs.as_xls import render_xls_to_string
from ..forms import EmailForm, InvoicesListForm from docs.forms import EmailForm, InvoicesListForm
from .. import filters from docs import filters
from project.customer.decorators import license_required from project.customer.decorators import license_required
from project.customer.utils import raise_if_no_profile from project.customer.utils import raise_if_no_profile

@ -3,12 +3,12 @@ from decimal import Decimal
from project.customer.forms import ClientsListForm from project.customer.forms import ClientsListForm
from ..models import Invoice, InvoiceItem from docs.models import Invoice, InvoiceItem
from ..forms import InvoiceForm, InvoiceItemForm from docs.forms import InvoiceForm, InvoiceItemForm
from ..filters import InvoiceFilterSet from docs.filters import InvoiceFilterSet
from .. import utils from docs import utils
from .base_views import BaseItemsViews from docs.views.base_views import BaseItemsViews
class InvoiceViews(BaseItemsViews): class InvoiceViews(BaseItemsViews):

@ -1 +1,2 @@
# -*- coding: utf-8 -*-
default_app_config = "myauth.apps.MyAuthConfig"

@ -0,0 +1,7 @@
# -*- coding: utf-8 -*-
from django.apps import AppConfig
class MyAuthConfig(AppConfig):
name = 'myauth'

@ -2,13 +2,13 @@
from django.template.loader import render_to_string from django.template.loader import render_to_string
from django.core.mail import EmailMessage from django.core.mail import EmailMessage
from django.conf import settings from django.conf import settings
from celery.decorators import task # from celery import shared_task
SUPPORT_EMAIL = getattr(settings, 'SUPPORT_EMAIL', '') SUPPORT_EMAIL = getattr(settings, 'SUPPORT_EMAIL', '')
@task # @shared_task
def send_registration_email(user_email, confirm_url): def send_registration_email(user_email, confirm_url):
"""Отправить письмо о регистрации нового пользователя.""" """Отправить письмо о регистрации нового пользователя."""
template_name = 'myauth/registration_email.txt' template_name = 'myauth/registration_email.txt'
@ -19,7 +19,7 @@ def send_registration_email(user_email, confirm_url):
return email.send() return email.send()
@task # @shared_task
def send_reset_password_email(user_email, confirm_url): def send_reset_password_email(user_email, confirm_url):
"""Отправить письмо с ключём для восстановления пароля.""" """Отправить письмо с ключём для восстановления пароля."""
template_name = 'myauth/reset_key_email.txt' template_name = 'myauth/reset_key_email.txt'
@ -30,7 +30,7 @@ def send_reset_password_email(user_email, confirm_url):
return email.send() return email.send()
@task # @shared_task
def send_new_password_email(user_email, new_password): def send_new_password_email(user_email, new_password):
"""Отправить письмо с новым паролем.""" """Отправить письмо с новым паролем."""
template_name = 'myauth/reset_new_password_email.txt' template_name = 'myauth/reset_new_password_email.txt'

@ -210,4 +210,5 @@ class CustomUserCreationForm(UserCreationForm):
class CustomUserChangeForm(UserChangeForm): class CustomUserChangeForm(UserChangeForm):
class Meta: class Meta:
model = DokUser model = DokUser
fields = '__all__'

@ -2,7 +2,6 @@
from django.db import models from django.db import models
from django.conf import settings from django.conf import settings
from django.core.validators import RegexValidator, MinLengthValidator from django.core.validators import RegexValidator, MinLengthValidator
#from django.contrib.auth.models import AbstractUser
from django.utils import timezone from django.utils import timezone
from django.utils.http import urlquote from django.utils.http import urlquote
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ugettext_lazy as _
@ -30,10 +29,11 @@ class DokUser(AbstractBaseUser, PermissionsMixin):
date_joined = models.DateTimeField(_('date joined'), default=timezone.now) date_joined = models.DateTimeField(_('date joined'), default=timezone.now)
profile = models.ForeignKey('customer.UserProfile', null=True, related_name='users') profile = models.ForeignKey('customer.UserProfile', null=True, related_name='users')
objects = managers.CustomUserManager() objects = managers.CustomUserManager()
USERNAME_FIELD = 'username' USERNAME_FIELD = 'username'
REQUIRED_FIELDS = ['email'] REQUIRED_FIELDS = ['email']
class Meta: class Meta:
verbose_name = _('user') verbose_name = _('user')
verbose_name_plural = _('users') verbose_name_plural = _('users')

@ -15,9 +15,9 @@ from django.conf import settings
from django.contrib.sessions.models import Session from django.contrib.sessions.models import Session
from django.contrib.auth.views import logout as django_logout from django.contrib.auth.views import logout as django_logout
from project.customer.models import UserProfile, UserProfileFilters, License from customer.models import UserProfile, UserProfileFilters, License
from . import forms, models, emails from myauth import forms, models, emails
REGISTRATION_OPEN = getattr(settings, 'REGISTRATION_OPEN', True) REGISTRATION_OPEN = getattr(settings, 'REGISTRATION_OPEN', True)

@ -6,6 +6,12 @@ import os
import sys import sys
from imp import find_module from imp import find_module
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
ROOT_DIR = os.path.dirname(
os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
print BASE_DIR
path = lambda *xs: os.path.abspath(os.path.join(os.path.dirname(__file__), *xs)) path = lambda *xs: os.path.abspath(os.path.join(os.path.dirname(__file__), *xs))
sys.path.insert(1, path('..')) sys.path.insert(1, path('..'))
@ -21,17 +27,6 @@ ADMINS = (
MANAGERS = ADMINS MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
'NAME': '', # Or path to database file if using sqlite3.
# The following settings are not used with sqlite3:
'USER': '',
'PASSWORD': '',
'HOST': '', # Empty for localhost through domain sockets or '127.0.0.1' for localhost through TCP.
'PORT': '', # Set to empty string for default.
}
}
# Hosts/domain names that are valid for this site; required if DEBUG is False # Hosts/domain names that are valid for this site; required if DEBUG is False
# See https://docs.djangoproject.com/en/1.5/ref/settings/#allowed-hosts # See https://docs.djangoproject.com/en/1.5/ref/settings/#allowed-hosts
@ -66,7 +61,6 @@ USE_TZ = True
# Absolute filesystem path to the directory that will hold user-uploaded files. # Absolute filesystem path to the directory that will hold user-uploaded files.
# Example: "/var/www/example.com/media/" # Example: "/var/www/example.com/media/"
#MEDIA_ROOT = path('../_public_html/media')
MEDIA_ROOT = path('../media') MEDIA_ROOT = path('../media')
# URL that handles the media served from MEDIA_ROOT. Make sure to use a # URL that handles the media served from MEDIA_ROOT. Make sure to use a
@ -74,7 +68,6 @@ MEDIA_ROOT = path('../media')
# Examples: "http://example.com/media/", "http://media.example.com/" # Examples: "http://example.com/media/", "http://media.example.com/"
MEDIA_URL = '/m/' MEDIA_URL = '/m/'
# STATIC_ROOT = path('../_public_html/static')
STATIC_ROOT = path('../static') STATIC_ROOT = path('../static')
# URL prefix for static files. # URL prefix for static files.
@ -89,23 +82,10 @@ STATICFILES_DIRS = (
path('static'), path('static'),
) )
# List of finder classes that know how to find static files in
# various locations.
STATICFILES_FINDERS = (
'django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
# 'django.contrib.staticfiles.finders.DefaultStorageFinder',
)
# Make this unique, and don't share it with anybody. # Make this unique, and don't share it with anybody.
SECRET_KEY = 'uqrv8bpqt-#up^ay-)^@bcjjgq1^jy8qc!fkr!1wd*u%)1dg#y' SECRET_KEY = 'uqrv8bpqt-#up^ay-)^@bcjjgq1^jy8qc!fkr!1wd*u%)1dg#y'
# List of callables that know how to import templates from various sources.
TEMPLATE_LOADERS = (
'django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader',
# 'django.template.loaders.eggs.Loader',
)
MIDDLEWARE_CLASSES = ( MIDDLEWARE_CLASSES = (
'django.contrib.sessions.middleware.SessionMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware',
@ -116,7 +96,7 @@ MIDDLEWARE_CLASSES = (
'django.contrib.messages.middleware.MessageMiddleware', 'django.contrib.messages.middleware.MessageMiddleware',
# Uncomment the next line for simple clickjacking protection: # Uncomment the next line for simple clickjacking protection:
'django.middleware.clickjacking.XFrameOptionsMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware',
'django.middleware.doc.XViewMiddleware', # 'django.middleware.doc.XViewMiddleware',
'cms.middleware.page.CurrentPageMiddleware', 'cms.middleware.page.CurrentPageMiddleware',
'cms.middleware.user.CurrentUserMiddleware', 'cms.middleware.user.CurrentUserMiddleware',
'cms.middleware.toolbar.ToolbarMiddleware', 'cms.middleware.toolbar.ToolbarMiddleware',
@ -127,24 +107,48 @@ MIDDLEWARE_CLASSES = (
'project.customer.middleware.ProfileMiddleware', 'project.customer.middleware.ProfileMiddleware',
) )
TEMPLATE_CONTEXT_PROCESSORS = ( # CHECK
'django.contrib.auth.context_processors.auth', # MIDDLEWARE_CLASSES = (
'django.contrib.messages.context_processors.messages', # 'cms.middleware.utils.ApphookReloadMiddleware',
'django.core.context_processors.i18n', # 'django.contrib.sessions.middleware.SessionMiddleware',
'django.core.context_processors.request', # 'django.middleware.csrf.CsrfViewMiddleware',
'django.core.context_processors.media', # 'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.core.context_processors.static', # 'django.contrib.messages.middleware.MessageMiddleware',
'cms.context_processors.cms_settings', # 'django.middleware.locale.LocaleMiddleware',
'sekizai.context_processors.sekizai', # 'django.middleware.common.CommonMiddleware',
'project.callback.context_processors.add_forms', # 'cms.middleware.user.CurrentUserMiddleware',
'project.customer.context_processors.license_check_soon_ends', # 'cms.middleware.page.CurrentPageMiddleware',
) # 'cms.middleware.toolbar.ToolbarMiddleware',
# 'cms.middleware.language.LanguageCookieMiddleware',
# )
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [
# os.path.join(BASE_DIR, 'templates'),
path('templates'),
ROOT_URLCONF = 'project.urls' ],
'APP_DIRS': True,
# Python dotted path to the WSGI application used by Django's runserver. 'OPTIONS': {
WSGI_APPLICATION = 'project.wsgi.application' 'context_processors': [
'django.contrib.auth.context_processors.auth',
'django.template.context_processors.debug',
'django.template.context_processors.i18n',
'django.template.context_processors.media',
'django.template.context_processors.static',
'django.template.context_processors.tz',
'django.contrib.messages.context_processors.messages',
'django.template.context_processors.request',
'django.template.context_processors.csrf',
'sekizai.context_processors.sekizai',
'cms.context_processors.cms_settings',
],
},
},
]
TEMPLATE_DIRS = ( TEMPLATE_DIRS = (
# Put strings here, like "/home/html/django_templates" or "C:/www/django/templates". # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
@ -153,18 +157,28 @@ TEMPLATE_DIRS = (
path('templates'), path('templates'),
) )
ROOT_URLCONF = 'project.urls'
# Python dotted path to the WSGI application used by Django's runserver.
WSGI_APPLICATION = 'project.wsgi.application'
INSTALLED_APPS = ( INSTALLED_APPS = (
'myauth',
'djangocms_admin_style',
'django.contrib.admin',
'django.contrib.auth', 'django.contrib.auth',
'django.contrib.contenttypes', 'django.contrib.contenttypes',
'django.contrib.sessions', 'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages', 'django.contrib.messages',
'django.contrib.sites',
'django.contrib.sitemaps',
'django.contrib.staticfiles', 'django.contrib.staticfiles',
# Uncomment the next line to enable the admin: 'django.contrib.admindocs',
'pytils', 'pytils',
# 'sorl.thumbnail',
# 'django_filters',
'autocomplete_light', 'autocomplete_light',
'cms', # django CMS itself 'cms', # django CMS itself
'mptt', # utilities for implementing a modified pre-order traversal tree 'mptt', # utilities for implementing a modified pre-order traversal tree
@ -172,41 +186,19 @@ INSTALLED_APPS = (
'sekizai', # for javascript and css management 'sekizai', # for javascript and css management
'captcha', 'captcha',
'yandex_money', 'yandex_money',
'djangocms_admin_style', # for the admin skin. You **must** add 'djangocms_admin_style' in the list before 'django.contrib.admin'.
'django.contrib.messages', # to enable messages framework (see :ref:`Enable messages <enable-messages>`)
'filer', 'filer',
'easy_thumbnails', 'easy_thumbnails',
'djangocms_file', 'treebeard',
'djangocms_flash',
'djangocms_googlemap',
'djangocms_inherit',
'djangocms_picture',
'djangocms_teaser',
'djangocms_video',
'djangocms_link',
'djangocms_snippet',
'djangocms_text_ckeditor',
'cmsplugin_filer_file',
'cmsplugin_filer_folder',
'cmsplugin_filer_link',
'cmsplugin_filer_image',
'cmsplugin_filer_teaser',
'cmsplugin_filer_video',
'djangocms_ckeditor_filer',
'django.contrib.admin',
'django.contrib.admindocs',
# my apps # my apps
'project.commons',
'project.myauth', 'commons',
'project.customer', 'customer',
'project.docs', 'docs',
'project.pages', 'pages',
'project.callback', 'callback',
'project.index_blocks', # 'project.index_blocks',
# keep it last
'south',
) )
AUTH_USER_MODEL = 'myauth.DokUser' AUTH_USER_MODEL = 'myauth.DokUser'
@ -334,6 +326,7 @@ CKEDITOR_SETTINGS = {
'removePlugins': 'image' 'removePlugins': 'image'
} }
TEXT_SAVE_IMAGE_FUNCTION = 'cmsplugin_filer_image.integrations.ckeditor.create_image_plugin' TEXT_SAVE_IMAGE_FUNCTION = 'cmsplugin_filer_image.integrations.ckeditor.create_image_plugin'
THUMBNAIL_PROCESSORS = ( THUMBNAIL_PROCESSORS = (
'easy_thumbnails.processors.colorspace', 'easy_thumbnails.processors.colorspace',
'easy_thumbnails.processors.autocrop', 'easy_thumbnails.processors.autocrop',

@ -21,13 +21,13 @@ urlpatterns = patterns('',
# Uncomment the next line to enable the admin: # Uncomment the next line to enable the admin:
url(r'^admin/', include(admin.site.urls)), url(r'^admin/', include(admin.site.urls)),
url(r'autocomplete/', include('autocomplete_light.urls')), url(r'autocomplete/', include('autocomplete_light.urls')),
url(r'^$', 'project.pages.views.site_index', name='site_index'), url(r'^$', 'pages.views.site_index', name='site_index'),
url(r'^my/', include('project.customer.urls')), url(r'^my/', include('customer.urls')),
url(r'^my/docs/', include('project.docs.urls')), url(r'^my/docs/', include('docs.urls')),
url(r'^my/callback/', include('project.callback.urls')), url(r'^my/callback/', include('callback.urls')),
url(r'^user/', include('project.myauth.urls')), url(r'^user/', include('myauth.urls')),
url(r'^captcha/', include('captcha.urls')), url(r'^captcha/', include('captcha.urls')),
url(r'^yandex-money/', include('yandex_money.urls')), url(r'^yandex-money/', include('yandex_money.urls')),
url(r'^', include('cms.urls')), url(r'^', include('cms.urls')),

Loading…
Cancel
Save