/etc/
и затем в bash_profile поменял TNS_ADMIN=/etc
. Перезагрузил компьютер и запустил проект. Проект теперь работает как следует без ошибок. Возможно неправильно настроены права доступа раз не работает когда файл находился в /opt/oracle/instantclient_11_2/
. Что думаете по этому поводу? >>> import cx_Oracle;
>>> dsn_tns=cx_Oracle.makedsn("XXX.XXX.XXX.XX", "XXXX", service_name="NAME")
>>> connection=cx_Oracle.connect("USER", "PASSWORD", dsn_tns)
>>> cursor=connection.cursor()
>>> cursor.execute("SELECT * FROM TABLE_NAME")
Ответ:
<cx_Oracle.Cursor on <cx_Oracle.Connection to WEB@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=XXX.XXX.XXX.XX)(PORT=XXXX))(CONNECT_DATA=(SERVICE_NAME=NAME)))>>
sudo nginx -t
и nginx -t
? Понятно sudo выполняет команду от имени администратора.nginx: the configuration file /usr/local/etc/nginx/nginx.conf syntax is ok
nginx: configuration file /usr/local/etc/nginx/nginx.conf test is successful
nginx: [alert] could not open error log file: open() "/usr/local/var/log/nginx/error.log" failed (13: Permission denied)
nginx: the configuration file /usr/local/etc/nginx/nginx.conf syntax is ok
2017/10/24 17:41:31 [emerg] 1140#0: open() "/usr/local/Cellar/nginx/1.12.2/logs/error.log" failed (13: Permission denied)
nginx: configuration file /usr/local/etc/nginx/nginx.conf test failed
/usr/local/etc/nginx/nginx.conf
и там были закоментированы следующие поля:#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;
bind = '127.0.0.1:8888'
. Обычно принята, чтобы Nginx слушал по 80. Не исключаю, что я где-то не догоняю. Подправьте пожалуйста меня если ошибаюсь. import string
rus = 'ETOPAHKXCBMetopahkxcbm' # Буквы кирилицы
eng = 'ETOPAHKXCBMetopahkxcbm' # Латинские буквы
form.cleaned_data['title'].translate(string.maketrans(dict(zip(eng, rus))))
form.save()
Traceback (most recent call last):
File "/srv/envs/py27/lib/python2.7/site-packages/django/core/handlers/exception.py", line 41, in inner
response = get_response(request)
File "/srv/envs/py27/lib/python2.7/site-packages/django/core/handlers/base.py", line 187, in _get_response
response = self.process_exception_by_middleware(e, request)
File "/srv/envs/py27/lib/python2.7/site-packages/django/core/handlers/base.py", line 185, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/srv/envs/py27/lib/python2.7/site-packages/django/views/generic/base.py", line 68, in view
return self.dispatch(request, *args, **kwargs)
File "/srv/envs/py27/lib/python2.7/site-packages/django/views/generic/base.py", line 88, in dispatch
return handler(request, *args, **kwargs)
File "/srv/envs/py27/lib/python2.7/site-packages/django/views/generic/edit.py", line 217, in post
return super(BaseCreateView, self).post(request, *args, **kwargs)
File "/srv/envs/py27/lib/python2.7/site-packages/django/views/generic/edit.py", line 183, in post
return self.form_valid(form)
File "/home/nurzhan/project/static_pages/views.py", line 56, in form_valid
form.cleaned_data['title'].translate(string.maketrans(dict(zip(eng, rus))))
TypeError: maketrans() takes exactly 2 arguments (1 given)
Traceback (most recent call last):
File "/srv/envs/py27/lib/python2.7/site-packages/django/core/handlers/exception.py", line 41, in inner
response = get_response(request)
File "/srv/envs/py27/lib/python2.7/site-packages/django/core/handlers/base.py", line 187, in _get_response
response = self.process_exception_by_middleware(e, request)
File "/srv/envs/py27/lib/python2.7/site-packages/django/core/handlers/base.py", line 185, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/srv/envs/py27/lib/python2.7/site-packages/django/views/generic/base.py", line 68, in view
return self.dispatch(request, *args, **kwargs)
File "/srv/envs/py27/lib/python2.7/site-packages/django/views/generic/base.py", line 88, in dispatch
return handler(request, *args, **kwargs)
File "/srv/envs/py27/lib/python2.7/site-packages/django/views/generic/edit.py", line 217, in post
return super(BaseCreateView, self).post(request, *args, **kwargs)
File "/srv/envs/py27/lib/python2.7/site-packages/django/views/generic/edit.py", line 183, in post
return self.form_valid(form)
File "/home/nurzhan/dashboard.kase.kz/static_pages/views.py", line 55, in form_valid
form.cleaned_data['title'].translate('ETOPAHKXCBMetopahkxcbm', 'ЕТОРАНКХСВМеторанкхсвм')
TypeError: translate() takes exactly one argument (2 given)
from string import maketrans
, но не помогло. Та же ошибка, что описывал выше. Traceback (most recent call last):
File "/srv/envs/py27/lib/python2.7/site-packages/django/core/handlers/exception.py", line 41, in inner
response = get_response(request)
File "/srv/envs/py27/lib/python2.7/site-packages/django/core/handlers/base.py", line 187, in _get_response
response = self.process_exception_by_middleware(e, request)
File "/srv/envs/py27/lib/python2.7/site-packages/django/core/handlers/base.py", line 185, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/srv/envs/py27/lib/python2.7/site-packages/django/views/generic/base.py", line 68, in view
return self.dispatch(request, *args, **kwargs)
File "/srv/envs/py27/lib/python2.7/site-packages/django/views/generic/base.py", line 88, in dispatch
return handler(request, *args, **kwargs)
File "/srv/envs/py27/lib/python2.7/site-packages/django/views/generic/edit.py", line 217, in post
return super(BaseCreateView, self).post(request, *args, **kwargs)
File "/srv/envs/py27/lib/python2.7/site-packages/django/views/generic/edit.py", line 183, in post
return self.form_valid(form)
File "/home/nurzhan/dashboard.kase.kz/static_pages/views.py", line 55, in form_valid
form.cleaned_data['head'].translate(str.maketrans(dict(zip(eng, rus))))
AttributeError: type object 'str' has no attribute 'maketrans'
form.cleaned_data['title'].translate(str.maketrans(dict(zip(eng, rus))))
form.save()
Traceback (most recent call last):
File "/srv/envs/py27/lib/python2.7/site-packages/django/core/handlers/exception.py", line 41, in inner
response = get_response(request)
File "/srv/envs/py27/lib/python2.7/site-packages/django/core/handlers/base.py", line 187, in _get_response
response = self.process_exception_by_middleware(e, request)
File "/srv/envs/py27/lib/python2.7/site-packages/django/core/handlers/base.py", line 185, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/srv/envs/py27/lib/python2.7/site-packages/django/views/generic/base.py", line 68, in view
return self.dispatch(request, *args, **kwargs)
File "/srv/envs/py27/lib/python2.7/site-packages/django/views/generic/base.py", line 88, in dispatch
return handler(request, *args, **kwargs)
File "/srv/envs/py27/lib/python2.7/site-packages/django/views/generic/edit.py", line 217, in post
return super(BaseCreateView, self).post(request, *args, **kwargs)
File "/srv/envs/py27/lib/python2.7/site-packages/django/views/generic/edit.py", line 183, in post
return self.form_valid(form)
File "/home/nurzhan/dashboard.kase.kz/static_pages/views.py", line 55, in form_valid
form.cleaned_data['head'].translate(str.maketrans(dict(zip(eng, rus))))
AttributeError: type object 'str' has no attribute 'maketrans'
form.cleaned_data['title'].translate(str.maketrans(dict(zip(eng, rus))))
form.save()
$("#articles").on("click", ".articleEditBtn", function(){
var btn = $(this);
$.ajax({
url: btn.attr("data-url"),
type: "get",
dataType: "json",
beforeSend: function(){
$("#articleModalBox").modal("show");
},
success: function (data) {
// ЗАГРУЖАЕМ ФОРМУ С ДАННЫМИ В МОДАЛЬНОЕ ОКНО
$("#articleModalBox .modal-content").html(data.html_article_edit_form);
// AUTOSIZE
document.querySelectorAll('textarea').forEach(function(i) {
alert("TEST");
i.focus();
autosize(document.querySelectorAll('textarea'));
});
}
});
});
autosize:update
. Применил следующий код:autosize.update(document.querySelectorAll('textarea'));
<textarea name="second_body" class="form-control" id="second_body" style="overflow-x: hidden; overflow-wrap: break-word;">ДЛИННЫЙ ТЕКСТ</textarea>
<textarea name="body_en" class="form-control" id="body_en" style="overflow: hidden; overflow-wrap: break-word; height: 214px;">LONG TEXT</textarea>
tnsnames.ora
обратна в/opt/oracle/instantclient_11_2/
. Подправил TNS_ADMIN в bash_profile). Перезагрузил компьютер и запустил проект. Сложно сказать из за чего была проблема. Ничего со вчерашнего дня не менял, думаю неисправность была в самой БД вчера.