ソースを参照

Installed CAS

ovrubinkovskaya 4 年 前
コミット
f7db112754
共有100 個のファイルを変更した558 個の追加8233 個の削除を含む
  1. 18 0
      .idea/dataSources.local.xml
  2. 13 0
      .idea/dataSources.xml
  3. 6 0
      .idea/inspectionProfiles/profiles_settings.xml
  4. 7 0
      .idea/misc.xml
  5. 8 0
      .idea/modules.xml
  6. 31 0
      .idea/untitled1.iml
  7. 176 0
      .idea/workspace.xml
  8. 0 0
      1.txt
  9. 0 195
      DjangoWebProject1.pyproj
  10. 0 6
      DjangoWebProject1.pyproj.user
  11. 0 3
      DjangoWebProject1/__init__.py
  12. BIN
      DjangoWebProject1/__init__.pyc
  13. BIN
      DjangoWebProject1/__pycache__/__init__.cpython-35.pyc
  14. BIN
      DjangoWebProject1/__pycache__/__init__.cpython-36.pyc
  15. BIN
      DjangoWebProject1/__pycache__/settings.cpython-35.pyc
  16. BIN
      DjangoWebProject1/__pycache__/settings.cpython-36.pyc
  17. BIN
      DjangoWebProject1/__pycache__/urls.cpython-35.pyc
  18. BIN
      DjangoWebProject1/__pycache__/urls.cpython-36.pyc
  19. BIN
      DjangoWebProject1/__pycache__/wsgi.cpython-35.pyc
  20. BIN
      DjangoWebProject1/__pycache__/wsgi.cpython-36.pyc
  21. 0 126
      DjangoWebProject1/settings.py
  22. BIN
      DjangoWebProject1/settings.pyc
  23. 0 46
      DjangoWebProject1/urls.py
  24. BIN
      DjangoWebProject1/urls.pyc
  25. 0 28
      DjangoWebProject1/wsgi.py
  26. 0 0
      SD/__init__.py
  27. BIN
      SD/__pycache__/__init__.cpython-37.pyc
  28. BIN
      SD/__pycache__/settings.cpython-37.pyc
  29. BIN
      SD/__pycache__/urls.cpython-37.pyc
  30. BIN
      SD/__pycache__/wsgi.cpython-37.pyc
  31. 16 0
      SD/asgi.py
  32. 137 0
      SD/settings.py
  33. 29 0
      SD/urls.py
  34. 16 0
      SD/wsgi.py
  35. BIN
      __pycache__/manage.cpython-37.pyc
  36. 45 0
      app/GetFace_Function.py
  37. 0 52
      app/GetFormular.py
  38. 47 0
      app/GetFormular_Function.py
  39. 0 3
      app/__init__.py
  40. BIN
      app/__init__.pyc
  41. BIN
      app/__pycache__/GetFace_Function.cpython-37.pyc
  42. BIN
      app/__pycache__/GetFormular_Function.cpython-37.pyc
  43. BIN
      app/__pycache__/__init__.cpython-35.pyc
  44. BIN
      app/__pycache__/__init__.cpython-36.pyc
  45. BIN
      app/__pycache__/forms.cpython-35.pyc
  46. BIN
      app/__pycache__/forms.cpython-36.pyc
  47. BIN
      app/__pycache__/forms.cpython-37.pyc
  48. BIN
      app/__pycache__/models.cpython-35.pyc
  49. BIN
      app/__pycache__/models.cpython-36.pyc
  50. BIN
      app/__pycache__/views.cpython-35.pyc
  51. BIN
      app/__pycache__/views.cpython-36.pyc
  52. BIN
      app/__pycache__/views.cpython-37.pyc
  53. 0 0
      app/catalog/__init__.py
  54. BIN
      app/catalog/__pycache__/__init__.cpython-35.pyc
  55. BIN
      app/catalog/__pycache__/admin.cpython-35.pyc
  56. BIN
      app/catalog/__pycache__/apps.cpython-35.pyc
  57. BIN
      app/catalog/__pycache__/forms.cpython-35.pyc
  58. BIN
      app/catalog/__pycache__/models.cpython-35.pyc
  59. BIN
      app/catalog/__pycache__/urls.cpython-35.pyc
  60. BIN
      app/catalog/__pycache__/views.cpython-35.pyc
  61. 0 9
      app/catalog/admin.py
  62. 0 5
      app/catalog/apps.py
  63. 0 28
      app/catalog/forms.py
  64. 0 61
      app/catalog/migrations/0001_initial.py
  65. 0 21
      app/catalog/migrations/0002_bookinstance_borrower.py
  66. 0 0
      app/catalog/migrations/__init__.py
  67. BIN
      app/catalog/migrations/__pycache__/0001_initial.cpython-35.pyc
  68. BIN
      app/catalog/migrations/__pycache__/0002_bookinstance_borrower.cpython-35.pyc
  69. BIN
      app/catalog/migrations/__pycache__/__init__.cpython-35.pyc
  70. 0 92
      app/catalog/models.py
  71. 0 5
      app/catalog/static/css/styles.css
  72. 0 45
      app/catalog/templates/base_generic.html
  73. 0 1
      app/catalog/templates/catalog/GetFace.py
  74. 0 14
      app/catalog/templates/catalog/author_confirm_delete.html
  75. 0 13
      app/catalog/templates/catalog/author_form.html
  76. 0 23
      app/catalog/templates/catalog/book_detail.html
  77. 0 19
      app/catalog/templates/catalog/book_list.html
  78. 0 23
      app/catalog/templates/catalog/book_renew_librarian.html
  79. 0 19
      app/catalog/templates/catalog/bookinstance_list_borrowed_user.html
  80. 0 16
      app/catalog/templates/getface.html
  81. 0 19
      app/catalog/templates/index.html
  82. 0 3
      app/catalog/tests.py
  83. 0 39
      app/catalog/urls.py
  84. 0 148
      app/catalog/views.py
  85. 9 17
      app/forms.py
  86. BIN
      app/forms.pyc
  87. 0 1
      app/migrations/__init__.py
  88. BIN
      app/migrations/__init__.pyc
  89. BIN
      app/migrations/__pycache__/__init__.cpython-35.pyc
  90. BIN
      app/migrations/__pycache__/__init__.cpython-36.pyc
  91. 0 8
      app/models.py
  92. BIN
      app/models.pyc
  93. 0 39
      app/scripts/GetFormular.py
  94. BIN
      app/scripts/__pycache__/GetFormular.cpython-35.pyc
  95. 0 6816
      app/static/app/content/bootstrap.css
  96. 0 20
      app/static/app/content/bootstrap.min.css
  97. 0 42
      app/static/app/content/site.css
  98. BIN
      app/static/app/fonts/glyphicons-halflings-regular.eot
  99. 0 228
      app/static/app/fonts/glyphicons-halflings-regular.svg
  100. 0 0
      app/static/app/fonts/glyphicons-halflings-regular.ttf

+ 18 - 0
.idea/dataSources.local.xml

@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="dataSourceStorageLocal">
+    <data-source name="Django default" uuid="23b67797-950f-45fc-8af5-acd58a68557c">
+      <database-info product="" version="" jdbc-version="" driver-name="" driver-version="" dbms="SQLITE" exact-version="0" />
+      <auth-required>false</auth-required>
+      <schema-mapping />
+      <ssh-properties>
+        <enabled>true</enabled>
+        <proxy-host>naru.mephi.ru</proxy-host>
+        <proxy-port>10026</proxy-port>
+        <user>ovkomleva</user>
+        <use-password>true</use-password>
+        <auth-type>PASSWORD</auth-type>
+      </ssh-properties>
+    </data-source>
+  </component>
+</project>

+ 13 - 0
.idea/dataSources.xml

@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="DataSourceManagerImpl" format="xml" multifile-model="true">
+    <data-source source="LOCAL" name="Django default" uuid="23b67797-950f-45fc-8af5-acd58a68557c">
+      <driver-ref>sqlite.xerial</driver-ref>
+      <synchronize>true</synchronize>
+      <imported>true</imported>
+      <remarks>$PROJECT_DIR$/untitled1/settings.py</remarks>
+      <jdbc-driver>org.sqlite.JDBC</jdbc-driver>
+      <jdbc-url>jdbc:sqlite:C:\Users\ox\PycharmProjects\untitled1\db.sqlite3</jdbc-url>
+    </data-source>
+  </component>
+</project>

+ 6 - 0
.idea/inspectionProfiles/profiles_settings.xml

@@ -0,0 +1,6 @@
+<component name="InspectionProjectProfileManager">
+  <settings>
+    <option name="USE_PROJECT_PROFILE" value="false" />
+    <version value="1.0" />
+  </settings>
+</component>

+ 7 - 0
.idea/misc.xml

@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="JavaScriptSettings">
+    <option name="languageLevel" value="ES6" />
+  </component>
+  <component name="ProjectRootManager" version="2" project-jdk-name="Python 3.7 (untitled1)" project-jdk-type="Python SDK" />
+</project>

+ 8 - 0
.idea/modules.xml

@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="ProjectModuleManager">
+    <modules>
+      <module fileurl="file://$PROJECT_DIR$/.idea/untitled1.iml" filepath="$PROJECT_DIR$/.idea/untitled1.iml" />
+    </modules>
+  </component>
+</project>

+ 31 - 0
.idea/untitled1.iml

@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module type="PYTHON_MODULE" version="4">
+  <component name="FacetManager">
+    <facet type="django" name="Django">
+      <configuration>
+        <option name="rootFolder" value="$MODULE_DIR$" />
+        <option name="settingsModule" value="untitled1/settings.py" />
+        <option name="manageScript" value="$MODULE_DIR$/manage.py" />
+        <option name="environment" value="&lt;map/&gt;" />
+        <option name="doNotUseTestRunner" value="false" />
+        <option name="trackFilePattern" value="migrations" />
+      </configuration>
+    </facet>
+  </component>
+  <component name="NewModuleRootManager">
+    <content url="file://$MODULE_DIR$">
+      <sourceFolder url="file://$MODULE_DIR$" isTestSource="false" />
+      <excludeFolder url="file://$MODULE_DIR$/venv" />
+    </content>
+    <orderEntry type="inheritedJdk" />
+    <orderEntry type="sourceFolder" forTests="false" />
+  </component>
+  <component name="TemplatesService">
+    <option name="TEMPLATE_CONFIGURATION" value="Django" />
+    <option name="TEMPLATE_FOLDERS">
+      <list>
+        <option value="$MODULE_DIR$/app/templates" />
+      </list>
+    </option>
+  </component>
+</module>

+ 176 - 0
.idea/workspace.xml

@@ -0,0 +1,176 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="ChangeListManager">
+    <list default="true" id="bd6e200c-a0e2-4827-a931-ab2c5ec6f387" name="Default Changelist" comment="" />
+    <option name="SHOW_DIALOG" value="false" />
+    <option name="HIGHLIGHT_CONFLICTS" value="true" />
+    <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
+    <option name="LAST_RESOLUTION" value="IGNORE" />
+  </component>
+  <component name="DjangoConsoleOptions" custom-start-script="import sys; print('Python %s on %s' % (sys.version, sys.platform))&#10;import django; print('Django %s' % django.get_version())&#10;sys.path.extend([WORKING_DIR_AND_PYTHON_PATHS])&#10;if 'setup' in dir(django): django.setup()&#10;import django_manage_shell; django_manage_shell.run(PROJECT_ROOT)">
+    <option name="myCustomStartScript" value="import sys; print('Python %s on %s' % (sys.version, sys.platform))&#10;import django; print('Django %s' % django.get_version())&#10;sys.path.extend([WORKING_DIR_AND_PYTHON_PATHS])&#10;if 'setup' in dir(django): django.setup()&#10;import django_manage_shell; django_manage_shell.run(PROJECT_ROOT)" />
+  </component>
+  <component name="FavoritesManager">
+    <favorites_list name="untitled1" />
+  </component>
+  <component name="ProjectId" id="1XKo7zY7DWHgGJvSKCbJHYS3Erz" />
+  <component name="ProjectViewState">
+    <option name="hideEmptyMiddlePackages" value="true" />
+    <option name="showExcludedFiles" value="true" />
+    <option name="showLibraryContents" value="true" />
+  </component>
+  <component name="PropertiesComponent">
+    <property name="RunOnceActivity.ShowReadmeOnStart" value="true" />
+    <property name="WebServerToolWindowFactoryState" value="false" />
+    <property name="settings.editor.selected.configurable" value="configurable.group.tools" />
+  </component>
+  <component name="RecentsManager">
+    <key name="MoveFile.RECENT_KEYS">
+      <recent name="C:\Users\ox\PycharmProjects\untitled1\app" />
+    </key>
+  </component>
+  <component name="RunManager" selected="Python.urls">
+    <configuration name="urls" type="PythonConfigurationType" factoryName="Python" temporary="true" nameIsGenerated="true">
+      <module name="untitled1" />
+      <option name="INTERPRETER_OPTIONS" value="" />
+      <option name="PARENT_ENVS" value="true" />
+      <envs>
+        <env name="PYTHONUNBUFFERED" value="1" />
+      </envs>
+      <option name="SDK_HOME" value="" />
+      <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/untitled1" />
+      <option name="IS_MODULE_SDK" value="true" />
+      <option name="ADD_CONTENT_ROOTS" value="true" />
+      <option name="ADD_SOURCE_ROOTS" value="true" />
+      <EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
+      <option name="SCRIPT_NAME" value="$PROJECT_DIR$/untitled1/urls.py" />
+      <option name="PARAMETERS" value="" />
+      <option name="SHOW_COMMAND_LINE" value="false" />
+      <option name="EMULATE_TERMINAL" value="false" />
+      <option name="MODULE_MODE" value="false" />
+      <option name="REDIRECT_INPUT" value="false" />
+      <option name="INPUT_FILE" value="" />
+      <method v="2" />
+    </configuration>
+    <configuration name="untitled1" type="Python.DjangoServer" factoryName="Django server">
+      <module name="untitled1" />
+      <option name="INTERPRETER_OPTIONS" value="" />
+      <option name="PARENT_ENVS" value="true" />
+      <envs>
+        <env name="PYTHONUNBUFFERED" value="1" />
+        <env name="DJANGO_SETTINGS_MODULE" value="untitled1.settings" />
+      </envs>
+      <option name="SDK_HOME" value="" />
+      <option name="WORKING_DIRECTORY" value="" />
+      <option name="IS_MODULE_SDK" value="false" />
+      <option name="ADD_CONTENT_ROOTS" value="true" />
+      <option name="ADD_SOURCE_ROOTS" value="true" />
+      <option name="launchJavascriptDebuger" value="false" />
+      <option name="port" value="8000" />
+      <option name="host" value="" />
+      <option name="additionalOptions" value="" />
+      <option name="browserUrl" value="" />
+      <option name="runTestServer" value="false" />
+      <option name="runNoReload" value="false" />
+      <option name="useCustomRunCommand" value="false" />
+      <option name="customRunCommand" value="" />
+      <method v="2" />
+    </configuration>
+    <recent_temporary>
+      <list>
+        <item itemvalue="Python.urls" />
+      </list>
+    </recent_temporary>
+  </component>
+  <component name="SvnConfiguration">
+    <configuration />
+  </component>
+  <component name="TaskManager">
+    <task active="true" id="Default" summary="Default task">
+      <changelist id="bd6e200c-a0e2-4827-a931-ab2c5ec6f387" name="Default Changelist" comment="" />
+      <created>1580803983406</created>
+      <option name="number" value="Default" />
+      <option name="presentableId" value="Default" />
+      <updated>1580803983406</updated>
+      <workItem from="1580803985397" duration="29997000" />
+      <workItem from="1581768801180" duration="339000" />
+      <workItem from="1581769153822" duration="202000" />
+      <workItem from="1581769369384" duration="5607000" />
+      <workItem from="1581787347189" duration="10336000" />
+    </task>
+    <servers />
+  </component>
+  <component name="TypeScriptGeneratedFilesManager">
+    <option name="version" value="1" />
+  </component>
+  <component name="WindowStateProjectService">
+    <state x="437" y="146" key="#com.intellij.execution.impl.EditConfigurationsDialog" timestamp="1581769266987">
+      <screen x="0" y="0" width="1920" height="1040" />
+    </state>
+    <state x="174" y="88" key="#com.intellij.execution.impl.EditConfigurationsDialog/0.0.1440.860@0.0.1440.860" timestamp="1581165905379" />
+    <state x="437" y="146" key="#com.intellij.execution.impl.EditConfigurationsDialog/0.0.1920.1040/1920.0.1920.1040@0.0.1920.1040" timestamp="1581769266987" />
+    <state width="1877" height="335" key="GridCell.Tab.0.bottom" timestamp="1581769355724">
+      <screen x="0" y="0" width="1920" height="1040" />
+    </state>
+    <state width="1397" height="276" key="GridCell.Tab.0.bottom/0.0.1440.860@0.0.1440.860" timestamp="1581443648351" />
+    <state width="1877" height="335" key="GridCell.Tab.0.bottom/0.0.1920.1040/1920.0.1920.1040@0.0.1920.1040" timestamp="1581769355724" />
+    <state width="1877" height="335" key="GridCell.Tab.0.center" timestamp="1581769355724">
+      <screen x="0" y="0" width="1920" height="1040" />
+    </state>
+    <state width="1397" height="276" key="GridCell.Tab.0.center/0.0.1440.860@0.0.1440.860" timestamp="1581443648339" />
+    <state width="1877" height="335" key="GridCell.Tab.0.center/0.0.1920.1040/1920.0.1920.1040@0.0.1920.1040" timestamp="1581769355724" />
+    <state width="1877" height="335" key="GridCell.Tab.0.left" timestamp="1581769355724">
+      <screen x="0" y="0" width="1920" height="1040" />
+    </state>
+    <state width="1397" height="276" key="GridCell.Tab.0.left/0.0.1440.860@0.0.1440.860" timestamp="1581443648325" />
+    <state width="1877" height="335" key="GridCell.Tab.0.left/0.0.1920.1040/1920.0.1920.1040@0.0.1920.1040" timestamp="1581769355724" />
+    <state width="1877" height="335" key="GridCell.Tab.0.right" timestamp="1581769355724">
+      <screen x="0" y="0" width="1920" height="1040" />
+    </state>
+    <state width="1397" height="276" key="GridCell.Tab.0.right/0.0.1440.860@0.0.1440.860" timestamp="1581443648339" />
+    <state width="1877" height="335" key="GridCell.Tab.0.right/0.0.1920.1040/1920.0.1920.1040@0.0.1920.1040" timestamp="1581769355724" />
+    <state width="1397" height="276" key="GridCell.Tab.1.bottom" timestamp="1581443648351">
+      <screen x="0" y="0" width="1440" height="860" />
+    </state>
+    <state width="1397" height="276" key="GridCell.Tab.1.bottom/0.0.1440.860@0.0.1440.860" timestamp="1581443648351" />
+    <state width="1397" height="276" key="GridCell.Tab.1.center" timestamp="1581443648351">
+      <screen x="0" y="0" width="1440" height="860" />
+    </state>
+    <state width="1397" height="276" key="GridCell.Tab.1.center/0.0.1440.860@0.0.1440.860" timestamp="1581443648351" />
+    <state width="1397" height="276" key="GridCell.Tab.1.left" timestamp="1581443648351">
+      <screen x="0" y="0" width="1440" height="860" />
+    </state>
+    <state width="1397" height="276" key="GridCell.Tab.1.left/0.0.1440.860@0.0.1440.860" timestamp="1581443648351" />
+    <state width="1397" height="276" key="GridCell.Tab.1.right" timestamp="1581443648351">
+      <screen x="0" y="0" width="1440" height="860" />
+    </state>
+    <state width="1397" height="276" key="GridCell.Tab.1.right/0.0.1440.860@0.0.1440.860" timestamp="1581443648351" />
+    <state x="223" y="76" key="SettingsEditor" timestamp="1581162951416">
+      <screen x="0" y="0" width="1440" height="860" />
+    </state>
+    <state x="223" y="76" key="SettingsEditor/0.0.1440.860@0.0.1440.860" timestamp="1581162951416" />
+    <state x="500" y="288" key="com.intellij.ide.util.TipDialog" timestamp="1581787347433">
+      <screen x="0" y="0" width="1440" height="860" />
+    </state>
+    <state x="500" y="288" key="com.intellij.ide.util.TipDialog/0.0.1440.860@0.0.1440.860" timestamp="1581787347433" />
+    <state x="667" y="348" key="com.intellij.ide.util.TipDialog/0.0.1920.1040/1920.0.1920.1040@0.0.1920.1040" timestamp="1581769372592" />
+    <state x="374" y="48" key="com.intellij.openapi.editor.actions.MultiplePasteAction$ClipboardContentChooser" timestamp="1581165184010">
+      <screen x="0" y="0" width="1440" height="860" />
+    </state>
+    <state x="374" y="48" key="com.intellij.openapi.editor.actions.MultiplePasteAction$ClipboardContentChooser/0.0.1440.860@0.0.1440.860" timestamp="1581165184010" />
+  </component>
+  <component name="XDebuggerManager">
+    <breakpoint-manager>
+      <breakpoints>
+        <line-breakpoint enabled="true" suspend="THREAD" type="python-line">
+          <url>file://$PROJECT_DIR$/app/views.py</url>
+          <line>87</line>
+          <option name="timeStamp" value="4" />
+        </line-breakpoint>
+      </breakpoints>
+    </breakpoint-manager>
+  </component>
+  <component name="com.intellij.coverage.CoverageDataManagerImpl">
+    <SUITE FILE_PATH="coverage/untitled1$urls.coverage" NAME="urls Coverage Results" MODIFIED="1581769344775" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/untitled1" />
+  </component>
+</project>

+ 0 - 0
1.txt


+ 0 - 195
DjangoWebProject1.pyproj

@@ -1,195 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
-  <PropertyGroup>
-    <VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
-    <Name>DjangoWebProject1</Name>
-    <RootNamespace>DjangoWebProject1</RootNamespace>
-    <InterpreterId>MSBuild|env|$(MSBuildProjectFullPath)</InterpreterId>
-  </PropertyGroup>
-  <PropertyGroup>
-    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
-    <SchemaVersion>2.0</SchemaVersion>
-    <ProjectGuid>6d5fbec2-8855-4835-b515-efa10ef6b805</ProjectGuid>
-    <ProjectHome>.</ProjectHome>
-    <ProjectTypeGuids>{5F0BE9CA-D677-4A4D-8806-6076C0FAAD37};{349c5851-65df-11da-9384-00065b846f21};{888888a0-9f3d-457c-b088-3a5042f75d52}</ProjectTypeGuids>
-    <StartupFile>manage.py</StartupFile>
-    <SearchPath>
-    </SearchPath>
-    <WorkingDirectory>.</WorkingDirectory>
-    <WebBrowserUrl>http://localhost</WebBrowserUrl>
-    <LaunchProvider>Django launcher</LaunchProvider>
-    <DjangoSettingsModule>DjangoWebProject1.settings</DjangoSettingsModule>
-    <OutputPath>.</OutputPath>
-    <SuppressCollectPythonCloudServiceFiles>true</SuppressCollectPythonCloudServiceFiles>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
-    <DebugSymbols>true</DebugSymbols>
-    <EnableUnmanagedDebugging>false</EnableUnmanagedDebugging>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
-    <DebugSymbols>true</DebugSymbols>
-    <EnableUnmanagedDebugging>false</EnableUnmanagedDebugging>
-  </PropertyGroup>
-  <ItemGroup>
-    <Compile Include="app\catalog\admin.py" />
-    <Compile Include="app\catalog\apps.py" />
-    <Compile Include="app\catalog\forms.py" />
-    <Compile Include="app\catalog\migrations\0001_initial.py" />
-    <Compile Include="app\catalog\migrations\0002_bookinstance_borrower.py" />
-    <Compile Include="app\catalog\migrations\__init__.py" />
-    <Compile Include="app\catalog\models.py" />
-    <Compile Include="app\catalog\templates\catalog\GetFace.py" />
-    <Compile Include="app\catalog\tests.py" />
-    <Compile Include="app\catalog\urls.py" />
-    <Compile Include="app\catalog\views.py" />
-    <Compile Include="app\catalog\__init__.py" />
-    <Compile Include="app\forms.py" />
-    <Compile Include="app\models.py" />
-    <Compile Include="app\tests.py" />
-    <Compile Include="app\views.py" />
-    <Compile Include="app\__init__.py" />
-    <Compile Include="app\migrations\__init__.py" />
-    <Compile Include="manage.py" />
-    <Compile Include="DjangoWebProject1\__init__.py" />
-    <Compile Include="DjangoWebProject1\settings.py" />
-    <Compile Include="DjangoWebProject1\urls.py" />
-    <Compile Include="DjangoWebProject1\wsgi.py" />
-  </ItemGroup>
-  <ItemGroup>
-    <Folder Include="app\" />
-    <Folder Include="app\catalog\migrations\" />
-    <Folder Include="app\catalog\migrations\__pycache__\" />
-    <Folder Include="app\catalog\static\" />
-    <Folder Include="app\catalog\static\css\" />
-    <Folder Include="app\catalog\templates\" />
-    <Folder Include="app\catalog\templates\catalog\" />
-    <Folder Include="app\catalog\templates\registration\" />
-    <Folder Include="app\catalog\__pycache__\" />
-    <Folder Include="app\migrations\" />
-    <Folder Include="app\catalog\" />
-    <Folder Include="app\static\" />
-    <Folder Include="app\static\app\" />
-    <Folder Include="app\static\app\content\" />
-    <Folder Include="app\static\app\fonts\" />
-    <Folder Include="app\static\app\scripts\" />
-    <Folder Include="app\templates\" />
-    <Folder Include="app\templates\app\" />
-    <Folder Include="app\templates\registration\" />
-    <Folder Include="DjangoWebProject1\" />
-  </ItemGroup>
-  <ItemGroup>
-    <Content Include="app\catalog\migrations\__pycache__\0001_initial.cpython-35.pyc" />
-    <Content Include="app\catalog\migrations\__pycache__\0002_bookinstance_borrower.cpython-35.pyc" />
-    <Content Include="app\catalog\migrations\__pycache__\__init__.cpython-35.pyc" />
-    <Content Include="app\catalog\static\css\styles.css" />
-    <Content Include="app\catalog\templates\base_generic.html" />
-    <Content Include="app\catalog\templates\catalog\author_confirm_delete.html" />
-    <Content Include="app\catalog\templates\catalog\author_form.html" />
-    <Content Include="app\catalog\templates\catalog\bookinstance_list_borrowed_user.html" />
-    <Content Include="app\catalog\templates\catalog\book_detail.html" />
-    <Content Include="app\catalog\templates\catalog\book_list.html" />
-    <Content Include="app\catalog\templates\catalog\book_renew_librarian.html" />
-    <Content Include="app\catalog\templates\getface.html" />
-    <Content Include="app\catalog\templates\index.html" />
-    <Content Include="app\catalog\__pycache__\admin.cpython-35.pyc" />
-    <Content Include="app\catalog\__pycache__\apps.cpython-35.pyc" />
-    <Content Include="app\catalog\__pycache__\forms.cpython-35.pyc" />
-    <Content Include="app\catalog\__pycache__\models.cpython-35.pyc" />
-    <Content Include="app\catalog\__pycache__\urls.cpython-35.pyc" />
-    <Content Include="app\catalog\__pycache__\views.cpython-35.pyc" />
-    <Content Include="app\catalog\__pycache__\__init__.cpython-35.pyc" />
-    <Content Include="app\templates\registration\logged_out.html" />
-    <Content Include="app\templates\registration\login.html" />
-    <Content Include="app\templates\registration\password_reset_complete.html" />
-    <Content Include="app\templates\registration\password_reset_confirm.html" />
-    <Content Include="app\templates\registration\password_reset_done.html" />
-    <Content Include="app\templates\registration\password_reset_email.html" />
-    <Content Include="app\templates\registration\password_reset_form.html" />
-    <Content Include="requirements.txt" />
-    <Content Include="db.sqlite3" />
-    <Content Include="app\static\app\content\bootstrap.css" />
-    <Content Include="app\static\app\content\bootstrap.min.css" />
-    <Content Include="app\static\app\content\site.css" />
-    <Content Include="app\static\app\fonts\glyphicons-halflings-regular.eot" />
-    <Content Include="app\static\app\fonts\glyphicons-halflings-regular.svg" />
-    <Content Include="app\static\app\fonts\glyphicons-halflings-regular.ttf" />
-    <Content Include="app\static\app\fonts\glyphicons-halflings-regular.woff" />
-    <Content Include="app\static\app\scripts\bootstrap.js" />
-    <Content Include="app\static\app\scripts\bootstrap.min.js" />
-    <Content Include="app\static\app\scripts\jquery-1.10.2.intellisense.js" />
-    <Content Include="app\static\app\scripts\jquery-1.10.2.js" />
-    <Content Include="app\static\app\scripts\jquery-1.10.2.min.js" />
-    <Content Include="app\static\app\scripts\jquery-1.10.2.min.map" />
-    <Content Include="app\static\app\scripts\jquery.validate-vsdoc.js" />
-    <Content Include="app\static\app\scripts\jquery.validate.js" />
-    <Content Include="app\static\app\scripts\jquery.validate.min.js" />
-    <Content Include="app\static\app\scripts\jquery.validate.unobtrusive.js" />
-    <Content Include="app\static\app\scripts\jquery.validate.unobtrusive.min.js" />
-    <Content Include="app\static\app\scripts\modernizr-2.6.2.js" />
-    <Content Include="app\static\app\scripts\respond.js" />
-    <Content Include="app\static\app\scripts\respond.min.js" />
-    <Content Include="app\static\app\scripts\_references.js" />
-    <Content Include="app\templates\app\about.html" />
-    <Content Include="app\templates\app\contact.html" />
-    <Content Include="app\templates\app\index.html" />
-    <Content Include="app\templates\app\layout.html" />
-    <Content Include="app\templates\app\login.html" />
-    <Content Include="app\templates\app\loginpartial.html" />
-  </ItemGroup>
-  <ItemGroup>
-    <None Include="readme.html">
-      <SubType>WebBrowser</SubType>
-    </None>
-  </ItemGroup>
-  <ItemGroup>
-    <Interpreter Include="env\">
-      <Id>env</Id>
-      <Version>3.6</Version>
-      <Description>env (Python 3.6 (64-bit))</Description>
-      <InterpreterPath>Scripts\python.exe</InterpreterPath>
-      <WindowsInterpreterPath>Scripts\pythonw.exe</WindowsInterpreterPath>
-      <PathEnvironmentVariable>PYTHONPATH</PathEnvironmentVariable>
-      <Architecture>X64</Architecture>
-    </Interpreter>
-  </ItemGroup>
-  <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\Python Tools\Microsoft.PythonTools.Django.targets" />
-  <!-- Specify pre- and post-build commands in the BeforeBuild and 
-       AfterBuild targets below. -->
-  <Target Name="BeforeBuild">
-  </Target>
-  <Target Name="AfterBuild">
-  </Target>
-  <ProjectExtensions>
-    <VisualStudio>
-      <FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
-        <WebProjectProperties>
-          <AutoAssignPort>True</AutoAssignPort>
-          <UseCustomServer>True</UseCustomServer>
-          <CustomServerUrl>http://localhost</CustomServerUrl>
-          <SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile>
-        </WebProjectProperties>
-      </FlavorProperties>
-      <FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}" User="">
-        <WebProjectProperties>
-          <StartPageUrl>
-          </StartPageUrl>
-          <StartAction>CurrentPage</StartAction>
-          <AspNetDebugging>True</AspNetDebugging>
-          <SilverlightDebugging>False</SilverlightDebugging>
-          <NativeDebugging>False</NativeDebugging>
-          <SQLDebugging>False</SQLDebugging>
-          <ExternalProgram>
-          </ExternalProgram>
-          <StartExternalURL>
-          </StartExternalURL>
-          <StartCmdLineArguments>
-          </StartCmdLineArguments>
-          <StartWorkingDirectory>
-          </StartWorkingDirectory>
-          <EnableENC>False</EnableENC>
-          <AlwaysStartWebServerOnDebug>False</AlwaysStartWebServerOnDebug>
-        </WebProjectProperties>
-      </FlavorProperties>
-    </VisualStudio>
-  </ProjectExtensions>
-</Project>

+ 0 - 6
DjangoWebProject1.pyproj.user

@@ -1,6 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <PropertyGroup>
-    <LastActiveSolutionConfig>Debug|Any CPU</LastActiveSolutionConfig>
-  </PropertyGroup>
-</Project>

+ 0 - 3
DjangoWebProject1/__init__.py

@@ -1,3 +0,0 @@
-"""
-Package for DjangoWebProject1.
-"""

BIN
DjangoWebProject1/__init__.pyc


BIN
DjangoWebProject1/__pycache__/__init__.cpython-35.pyc


BIN
DjangoWebProject1/__pycache__/__init__.cpython-36.pyc


BIN
DjangoWebProject1/__pycache__/settings.cpython-35.pyc


BIN
DjangoWebProject1/__pycache__/settings.cpython-36.pyc


BIN
DjangoWebProject1/__pycache__/urls.cpython-35.pyc


BIN
DjangoWebProject1/__pycache__/urls.cpython-36.pyc


BIN
DjangoWebProject1/__pycache__/wsgi.cpython-35.pyc


BIN
DjangoWebProject1/__pycache__/wsgi.cpython-36.pyc


+ 0 - 126
DjangoWebProject1/settings.py

@@ -1,126 +0,0 @@
-"""
-Django settings for DjangoWebProject1 project.
-
-Generated by 'django-admin startproject' using Django 1.9.1.
-
-For more information on this file, see
-https://docs.djangoproject.com/en/1.9/topics/settings/
-
-For the full list of settings and their values, see
-https://docs.djangoproject.com/en/1.9/ref/settings/
-"""
-
-import os
-import posixpath
-
-# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
-BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
-
-
-# Quick-start development settings - unsuitable for production
-# See https://docs.djangoproject.com/en/1.9/howto/deployment/checklist/
-
-# SECURITY WARNING: keep the secret key used in production secret!
-SECRET_KEY = 'b82f6c80-2fb7-45b5-bf07-f8a58fa3782d'
-
-# SECURITY WARNING: don't run with debug turned on in production!
-DEBUG = True
-
-ALLOWED_HOSTS = []
-
-
-# Application definition
-
-INSTALLED_APPS = [
-    'app',
-    # Add your apps here to enable them
-    'django.contrib.admin',
-    'django.contrib.auth',
-    'django.contrib.contenttypes',
-    'django.contrib.sessions',
-    'django.contrib.messages',
-    'django.contrib.staticfiles',
-]
-
-MIDDLEWARE_CLASSES = [
-    'django.middleware.security.SecurityMiddleware',
-    '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 = 'DjangoWebProject1.urls'
-
-TEMPLATES = [
-    {
-        'BACKEND': 'django.template.backends.django.DjangoTemplates',
-        'DIRS': [],
-        'APP_DIRS': True,
-        'OPTIONS': {
-            'context_processors': [
-                'django.template.context_processors.debug',
-                'django.template.context_processors.request',
-                'django.contrib.auth.context_processors.auth',
-                'django.contrib.messages.context_processors.messages',
-            ],
-        },
-    },
-]
-
-WSGI_APPLICATION = 'DjangoWebProject1.wsgi.application'
-
-
-# Database
-# https://docs.djangoproject.com/en/1.9/ref/settings/#databases
-
-DATABASES = {
-    'default': {
-        'ENGINE': 'django.db.backends.sqlite3',
-        'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
-    }
-}
-
-
-# Password validation
-# https://docs.djangoproject.com/en/1.9/ref/settings/#auth-password-validators
-
-AUTH_PASSWORD_VALIDATORS = [
-    {
-        'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
-    },
-    {
-        'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
-    },
-    {
-        'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
-    },
-    {
-        'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
-    },
-]
-
-
-# Internationalization
-# https://docs.djangoproject.com/en/1.9/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.9/howto/static-files/
-
-STATIC_URL = '/static/'
-
-STATIC_ROOT = posixpath.join(*(BASE_DIR.split(os.path.sep) + ['static']))

BIN
DjangoWebProject1/settings.pyc


+ 0 - 46
DjangoWebProject1/urls.py

@@ -1,46 +0,0 @@
-"""
-Definition of urls for DjangoWebProject1.
-"""
-
-from datetime import datetime
-from django.conf.urls import url
-import django.contrib.auth.views
-
-import app.forms
-import app.views
-
-# Uncomment the next lines to enable the admin:
-# from django.conf.urls import include
-# from django.contrib import admin
-# admin.autodiscover()
-
-urlpatterns = [
-    # Examples:
-    url(r'^$', app.views.home, name='home'),
-    url(r'^contact$', app.views.contact, name='contact'),
-    url(r'^about$', app.views.about, name='about'),
-    url(r'^login/$',
-        django.contrib.auth.views.login,
-        {
-            'template_name': 'app/login.html',
-            'authentication_form': app.forms.BootstrapAuthenticationForm,
-            'extra_context':
-            {
-                'title': 'Log in',
-                'year': datetime.now().year,
-            }
-        },
-        name='login'),
-    url(r'^logout$',
-        django.contrib.auth.views.logout,
-        {
-            'next_page': '/',
-        },
-        name='logout'),
-
-    # Uncomment the admin/doc line below to enable admin documentation:
-    # url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
-
-    # Uncomment the next line to enable the admin:
-    # url(r'^admin/', include(admin.site.urls)),
-]

BIN
DjangoWebProject1/urls.pyc


+ 0 - 28
DjangoWebProject1/wsgi.py

@@ -1,28 +0,0 @@
-"""
-WSGI config for DjangoWebProject1 project.
-
-This module contains the WSGI application used by Django's development server
-and any production WSGI deployments. It should expose a module-level variable
-named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
-this application via the ``WSGI_APPLICATION`` setting.
-
-Usually you will have the standard Django WSGI application here, but it also
-might make sense to replace the whole Django WSGI application with a custom one
-that later delegates to the Django one. For example, you could introduce WSGI
-middleware here, or combine a Django application with an application of another
-framework.
-
-"""
-import os
-
-os.environ.setdefault("DJANGO_SETTINGS_MODULE", "DjangoWebProject1.settings")
-
-# This application object is used by any WSGI server configured to use this
-# file. This includes Django's development server, if the WSGI_APPLICATION
-# setting points here.
-from django.core.wsgi import get_wsgi_application
-application = get_wsgi_application()
-
-# Apply WSGI middleware here.
-# from helloworld.wsgi import HelloWorldApplication
-# application = HelloWorldApplication(application)

env/Lib/site-packages/urllib3/packages/backports/__init__.py → SD/__init__.py


BIN
SD/__pycache__/__init__.cpython-37.pyc


BIN
SD/__pycache__/settings.cpython-37.pyc


BIN
SD/__pycache__/urls.cpython-37.pyc


BIN
SD/__pycache__/wsgi.cpython-37.pyc


+ 16 - 0
SD/asgi.py

@@ -0,0 +1,16 @@
+"""
+ASGI config for untitled1 project.
+
+It exposes the ASGI callable as a module-level variable named ``application``.
+
+For more information on this file, see
+https://docs.djangoproject.com/en/3.0/howto/deployment/asgi/
+"""
+
+import os
+
+from django.core.asgi import get_asgi_application
+
+os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'untitled1.settings')
+
+application = get_asgi_application()

+ 137 - 0
SD/settings.py

@@ -0,0 +1,137 @@
+"""
+Django settings for SD project.
+
+Generated by 'django-admin startproject' using Django 3.0.3.
+
+For more information on this file, see
+https://docs.djangoproject.com/en/3.0/topics/settings/
+
+For the full list of settings and their values, see
+https://docs.djangoproject.com/en/3.0/ref/settings/
+"""
+
+import os
+
+# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
+BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
+
+
+# Quick-start development settings - unsuitable for production
+# See https://docs.djangoproject.com/en/3.0/howto/deployment/checklist/
+
+# SECURITY WARNING: keep the secret key used in production secret!
+SECRET_KEY = 'dfscc)0utc_+-smnhvb2)fqmq^#@2!wh1vzps%cax3#ybe&!0i'
+
+# SECURITY WARNING: don't run with debug turned on in production!
+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',
+	'cas',
+    'bootstrap3',
+]
+
+MIDDLEWARE = [
+    'django.middleware.security.SecurityMiddleware',
+    'django.contrib.sessions.middleware.SessionMiddleware',
+    'django.middleware.common.CommonMiddleware',
+    'django.middleware.csrf.CsrfViewMiddleware',
+    'django.contrib.auth.middleware.AuthenticationMiddleware',
+    'django.contrib.messages.middleware.MessageMiddleware',
+    'django.middleware.clickjacking.XFrameOptionsMiddleware',
+    'cas.middleware.CASMiddleware'
+]
+
+ROOT_URLCONF = 'SD.urls'
+
+TEMPLATES = [
+    {
+        'BACKEND': 'django.template.backends.django.DjangoTemplates',
+        'DIRS': [os.path.join(BASE_DIR, 'app/templates')]
+        ,
+        'APP_DIRS': True,
+        'OPTIONS': {
+            'context_processors': [
+                'django.template.context_processors.debug',
+                'django.template.context_processors.request',
+                'django.contrib.auth.context_processors.auth',
+                'django.contrib.messages.context_processors.messages',
+            ],
+        },
+    },
+]
+
+WSGI_APPLICATION = 'SD.wsgi.application'
+
+
+# Database
+# https://docs.djangoproject.com/en/3.0/ref/settings/#databases
+
+DATABASES = {
+    'default': {
+        'ENGINE': 'django.db.backends.sqlite3',
+        'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
+    }
+}
+
+
+# Password validation
+# https://docs.djangoproject.com/en/3.0/ref/settings/#auth-password-validators
+
+AUTH_PASSWORD_VALIDATORS = [
+    {
+        'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
+    },
+    {
+        'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
+    },
+    {
+        'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
+    },
+    {
+        'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
+    },
+]
+
+
+# Internationalization
+# https://docs.djangoproject.com/en/3.0/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/3.0/howto/static-files/
+
+STATIC_URL = '/static/'
+STATICFILES_DIRS = [
+    os.path.join(BASE_DIR, "static"),
+]
+
+# CAS 
+CAS_SERVER_URL = 'https://login.mephi.ru/'
+CAS_LOGOUT_COMPLETELY = True
+CAS_PROVIDE_URL_TO_LOGOUT = True
+
+AUTHENTICATION_BACKENDS = (
+    'django.contrib.auth.backends.ModelBackend',
+    'cas.backends.CASBackend',
+)

+ 29 - 0
SD/urls.py

@@ -0,0 +1,29 @@
+"""untitled1 URL Configuration
+
+The `urlpatterns` list routes URLs to views. For more information please see:
+    https://docs.djangoproject.com/en/3.0/topics/http/urls/
+Examples:
+Function views
+    1. Add an import:  from my_app import views
+    2. Add a URL to urlpatterns:  path('', views.home, name='home')
+Class-based views
+    1. Add an import:  from other_app.views import Home
+    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
+Including another URLconf
+    1. Import the include() function: from django.urls import include, path
+    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
+"""
+from django.contrib import admin
+from django.urls import path
+from django.conf.urls import url, include
+import cas.views
+from django.views.generic import TemplateView
+from app.views import FindForm, RedirectView
+
+urlpatterns = [
+    path('admin/', admin.site.urls),
+	path('cas/login/', cas.views.login, name='login'),
+    path('cas/logout/', cas.views.logout, name='logout'),
+    path('', RedirectView.as_view(template_name='index.html')),
+    path('form.html', FindForm.as_view()),
+]

+ 16 - 0
SD/wsgi.py

@@ -0,0 +1,16 @@
+"""
+WSGI config for untitled1 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/3.0/howto/deployment/wsgi/
+"""
+
+import os
+
+from django.core.wsgi import get_wsgi_application
+
+os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'untitled1.settings')
+
+application = get_wsgi_application()

BIN
__pycache__/manage.cpython-37.pyc


+ 45 - 0
app/GetFace_Function.py

@@ -0,0 +1,45 @@
+def GetFace(host, api, api_key, surname, uid = '0', firstname = '0', middlename = '0'):
+    '''
+    Описываем функцию, где обязательные параметры host, api и api_key отвечают за формирование url,
+    обязательный параметр surname соотвествует фамилии пользователя,
+    остальные параметры (uid - id пользователя, firstname - имя, middlename - отчетство) являются необязательными.
+    '''
+    import json # импортируем библиотеку для работы с json
+    import requests # импортируем библиотеку для работы с http
+    url = ''.join([str(host), str(api), 'api_key=', str(api_key)]) # формируем полный url
+    response = requests.get(url) # создание подключения
+    response.encoding = 'utf-8'
+    data = response.json() # сохранение данных в json
+    if uid == '':
+        uid = 0
+    else:
+        uid = int(uid or 0)
+    if firstname == '':
+        firstname = '0'
+    if middlename == '':
+        middlename = '0'
+    ### Валидация
+    assert isinstance(uid, int), 'EmpGUID  should be an int'
+    assert isinstance(surname, str) and surname.isspace() != True, 'surname should be a non-space string'
+    assert isinstance(surname, str) and surname, 'Введите фамилию сотрудника'
+    assert isinstance(firstname, str) and firstname.isspace() != True, 'firstname should be a non-space string'
+    assert isinstance(middlename, str) and middlename.isspace() != True, 'middlename should be a non-space string'
+    ### Валидация
+    face = [] # пустой список для добавления найденных результатов
+    main_cond = "f['SurName'] == surname" # главное условие поиска
+    name_params = ["f['EmpGUID']", "f['FirstName']", "f['MiddleName']"] # имена параметров в json
+    params = [str(uid), str(firstname), str(middlename)] # список передаваемых параметров
+    conditions = [] # пустой список для дополнительный условий поиска
+    for i in range(len(params)):
+        if params[i] != str(0):
+            conditions.append('and str({}) == "{}"'.format(name_params[i], params[i].strip()))
+    other_cond = ' '.join([x for x in conditions])
+    search = main_cond + ' ' + other_cond
+    for f in data: # цикл поиска по каждому элементу списка в data
+        if eval(search): # условие поиска
+            face.append(f) # добавляем найденные данные в список
+    with open('face.json', 'w') as write_file: # создание пустого файла для записи
+        json.dump(face, write_file) # запись найденного содержимого в json файл
+    if len(face) == 0: # обработка исключений
+        print('Сотрудник не найден') # вывод сообщения в случае отсутствия совпадений   
+

+ 0 - 52
app/GetFormular.py

@@ -1,52 +0,0 @@
-def GetFormular(host, api, api_key, surname, uid = 0, firstname = '0', middlename = '0'): 
-    url = ''.join([str(host), str(api), 'api_key=', str(api_key)]) 
-    response = requests.get(url) 
-    data = response.json() 
-    if uid == '':
-        uid = 0
-    else:
-        uid = int(uid)
-    if firstname == '':
-        firstname = '0'
-    if middlename == '':
-        middlename = '0'
-    surname = str(surname)
-    assert isinstance(uid, int), 'EmpGUID  should be an int'
-    assert isinstance(surname, str) and surname.isspace() != True, 'surname should be a non-space string'
-    assert isinstance(surname, str) and surname, 'Введите фамилию �отрудника'
-    assert isinstance(firstname, str) and firstname.isspace() != True, 'firstname should be a non-space string'
-    assert isinstance(middlename, str) and middlename.isspace() != True, 'middlename should be a non-space string'
-    formular = []в
-    main_cond = "f['SurName'] == surname" ка
-    name_params = ["f['EmpGUID']", "f['FirstName']", "f['MiddleName']"] 
-    params = [str(uid), str(firstname), str(middlename)] ¾Ð²
-    conditions = [] ºÐ°
-    for i in range(len(params)):
-        if params[i] != str(0):
-            conditions.append('and str({}) == "{}"'.format(name_params[i], params[i].strip()))
-    other_cond = ' '.join([x for x in conditions])
-    search = main_cond + ' ' + other_cond
-    print(search)
-    for f in data: 
-        if eval(search): ка
-            formular.append(f) ок
-    with open('formular.json', 'w') as write_file: ¸
-        json.dump(formular, write_file) °Ð¹Ð»
-    if len(formular) == 0: µÐ½Ð¸Ð¹
-        print('Not Found')¾Ð²Ð¿Ð°Ð´ÐµÐ½Ð¸Ð¹
-
-def formular(request):
-    """Renders the home page."""
-    assert isinstance(request, HttpRequest)
-    a='Search by individuals'
-    if request.method == "POST":
-        a=GetFace(host = 'https://sd.mephi.ru/', api = 'api/1/formulars.json?', api_key = 'bai7phaxief4iecooTh:eeke',firstname = request.POST.get("firstname"), surname = request.POST.get("surname"), middlename = request.POST.get("middlename"), uid = request.POST.get("uid"))
-    return render(
-        request,
-        'app/getformular.html',
-        {
-            'title':'Get Formular',
-            'year':datetime.now().year,
-            'table': a,
-        }
-    )

+ 47 - 0
app/GetFormular_Function.py

@@ -0,0 +1,47 @@
+def GetFormular(host, api, api_key, surname, uid = '0', firstname = '0', middlename = '0'):
+    '''
+    Описываем функцию, где обязательные параметры host, api и api_key отвечают за формирование url,
+    обязательный параметр surname соотвествует фамилии пользователя,
+    остальные параметры (uid - id пользователя, firstname - имя, middlename - отчетство) являются необязательными.
+    '''
+    import json # импортируем библиотеку для работы с json
+    import requests # импортируем библиотеку для работы с http
+    url = ''.join([str(host), str(api), 'api_key=', str(api_key)]) # формируем полный url
+    response = requests.get(url) # создание подключения\
+    response.encoding = 'utf-8'
+    data = response.json() # сохранение данных в json
+    #with open('data/formulars.json', 'r') as file:
+    #    data = json.load(file)
+    if uid == '':
+        uid = 0
+    else:
+        uid = int(uid or 0)
+    if firstname == '':
+        firstname = '0'
+    if middlename == '':
+        middlename = '0'
+    ### Валидация
+    assert isinstance(uid, int), 'EmpGUID  should be an int'
+    assert isinstance(surname, str) and surname.isspace() != True, 'surname should be a non-space string'
+    assert isinstance(surname, str) and surname, 'Введите фамилию сотрудника'
+    assert isinstance(firstname, str) and firstname.isspace() != True, 'firstname should be a non-space string'
+    assert isinstance(middlename, str) and middlename.isspace() != True, 'middlename should be a non-space string'
+    ### Валидация
+    formular = [] # пустой список для добавления найденных результатов
+    main_cond = "f['SurName'] == surname" # главное условие поиска
+    name_params = ["f['EmpGUID']", "f['FirstName']", "f['MiddleName']"] # имена параметров в json
+    params = [str(uid), str(firstname), str(middlename)] # список передаваемых параметров
+    conditions = [] # пустой список для дополнительный условий поиска
+    for i in range(len(params)):
+        if params[i] != str(0):
+            conditions.append('and str({}) == "{}"'.format(name_params[i], params[i].strip()))
+    other_cond = ' '.join([x for x in conditions])
+    search = main_cond + ' ' + other_cond
+    for f in data: # цикл поиска по каждому элементу списка в data
+        if eval(search): # условие поиска
+            formular.append(f) # добавляем найденные данные в список
+    with open('formular.json', 'w') as write_file: # создание пустого файла для записи
+        json.dump(formular, write_file) # запись найденного содержимого в json файл
+    if len(formular) == 0: # обработка исключений
+        print('Сотрудник не найден') # вывод сообщения в случае отсутствия совпадений  
+

+ 0 - 3
app/__init__.py

@@ -1,3 +0,0 @@
-"""
-Package for the application.
-"""

BIN
app/__init__.pyc


BIN
app/__pycache__/GetFace_Function.cpython-37.pyc


BIN
app/__pycache__/GetFormular_Function.cpython-37.pyc


BIN
app/__pycache__/__init__.cpython-35.pyc


BIN
app/__pycache__/__init__.cpython-36.pyc


BIN
app/__pycache__/forms.cpython-35.pyc


BIN
app/__pycache__/forms.cpython-36.pyc


BIN
app/__pycache__/forms.cpython-37.pyc


BIN
app/__pycache__/models.cpython-35.pyc


BIN
app/__pycache__/models.cpython-36.pyc


BIN
app/__pycache__/views.cpython-35.pyc


BIN
app/__pycache__/views.cpython-36.pyc


BIN
app/__pycache__/views.cpython-37.pyc


+ 0 - 0
app/catalog/__init__.py


BIN
app/catalog/__pycache__/__init__.cpython-35.pyc


BIN
app/catalog/__pycache__/admin.cpython-35.pyc


BIN
app/catalog/__pycache__/apps.cpython-35.pyc


BIN
app/catalog/__pycache__/forms.cpython-35.pyc


BIN
app/catalog/__pycache__/models.cpython-35.pyc


BIN
app/catalog/__pycache__/urls.cpython-35.pyc


BIN
app/catalog/__pycache__/views.cpython-35.pyc


+ 0 - 9
app/catalog/admin.py

@@ -1,9 +0,0 @@
-from django.contrib import admin
-
-# Register your models here.
-from .models import Author, Genre, Book, BookInstance
-
-admin.site.register(Book)
-admin.site.register(Author)
-admin.site.register(Genre)
-admin.site.register(BookInstance)

+ 0 - 5
app/catalog/apps.py

@@ -1,5 +0,0 @@
-from django.apps import AppConfig
-
-
-class CatalogConfig(AppConfig):
-    name = 'catalog'

+ 0 - 28
app/catalog/forms.py

@@ -1,28 +0,0 @@
-import datetime
-
-from django import forms
-from django.core.exceptions import ValidationError
-from django.utils.translation import ugettext_lazy as _
-
-class RenewBookForm(forms.Form):
-    renewal_date = forms.DateField(help_text="Enter a date between now and 4 weeks (default 3).")
-
-    def clean_renewal_date(self):
-        data = self.cleaned_data['renewal_date']
-        
-        # Check if a date is not in the past. 
-        if data < datetime.date.today():
-            raise ValidationError(_('Invalid date - renewal in past'))
-
-        # Check if a date is in the allowed range (+4 weeks from today).
-        if data > datetime.date.today() + datetime.timedelta(weeks=4):
-            raise ValidationError(_('Invalid date - renewal more than 4 weeks ahead'))
-
-        # Remember to always return the cleaned data.
-        return data
-
-class UserForm(forms.Form):
-    surname = forms.CharField()
-    firstname = forms.CharField()
-    middlename = forms.CharField()
-    uid = forms.IntegerField()

+ 0 - 61
app/catalog/migrations/0001_initial.py

@@ -1,61 +0,0 @@
-# Generated by Django 2.0.2 on 2019-09-28 20:29
-
-from django.db import migrations, models
-import django.db.models.deletion
-import uuid
-
-
-class Migration(migrations.Migration):
-
-    initial = True
-
-    dependencies = [
-    ]
-
-    operations = [
-        migrations.CreateModel(
-            name='Author',
-            fields=[
-                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
-                ('first_name', models.CharField(max_length=100)),
-                ('last_name', models.CharField(max_length=100)),
-                ('date_of_birth', models.DateField(blank=True, null=True)),
-                ('date_of_death', models.DateField(blank=True, null=True, verbose_name='Died')),
-            ],
-        ),
-        migrations.CreateModel(
-            name='Book',
-            fields=[
-                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
-                ('title', models.CharField(max_length=200)),
-                ('summary', models.TextField(help_text='Enter a brief description of the book', max_length=1000)),
-                ('isbn', models.CharField(help_text='13 Character <a href="https://www.isbn-international.org/content/what-isbn">ISBN number</a>', max_length=13, verbose_name='ISBN')),
-                ('author', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='catalog.Author')),
-            ],
-        ),
-        migrations.CreateModel(
-            name='BookInstance',
-            fields=[
-                ('id', models.UUIDField(default=uuid.uuid4, help_text='Unique ID for this particular book across whole library', primary_key=True, serialize=False)),
-                ('imprint', models.CharField(max_length=200)),
-                ('due_back', models.DateField(blank=True, null=True)),
-                ('status', models.CharField(blank=True, choices=[('m', 'Maintenance'), ('o', 'On loan'), ('a', 'Available'), ('r', 'Reserved')], default='m', help_text='Book availability', max_length=1)),
-                ('book', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='catalog.Book')),
-            ],
-            options={
-                'ordering': ['due_back'],
-            },
-        ),
-        migrations.CreateModel(
-            name='Genre',
-            fields=[
-                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
-                ('name', models.CharField(help_text='Enter a book genre (e.g. Science Fiction, French Poetry etc.)', max_length=200)),
-            ],
-        ),
-        migrations.AddField(
-            model_name='book',
-            name='genre',
-            field=models.ManyToManyField(help_text='Select a genre for this book', to='catalog.Genre'),
-        ),
-    ]

+ 0 - 21
app/catalog/migrations/0002_bookinstance_borrower.py

@@ -1,21 +0,0 @@
-# Generated by Django 2.0.2 on 2019-09-29 15:59
-
-from django.conf import settings
-from django.db import migrations, models
-import django.db.models.deletion
-
-
-class Migration(migrations.Migration):
-
-    dependencies = [
-        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
-        ('catalog', '0001_initial'),
-    ]
-
-    operations = [
-        migrations.AddField(
-            model_name='bookinstance',
-            name='borrower',
-            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL),
-        ),
-    ]

+ 0 - 0
app/catalog/migrations/__init__.py


BIN
app/catalog/migrations/__pycache__/0001_initial.cpython-35.pyc


BIN
app/catalog/migrations/__pycache__/0002_bookinstance_borrower.cpython-35.pyc


BIN
app/catalog/migrations/__pycache__/__init__.cpython-35.pyc


+ 0 - 92
app/catalog/models.py

@@ -1,92 +0,0 @@
-from django.db import models
-
-# Create your models here.
-
-from django.urls import reverse
-class Genre(models.Model):
-    """
-    Model representing a book genre (e.g. Science Fiction, Non Fiction).
-    """
-    name = models.CharField(max_length=200, help_text="Enter a book genre (e.g. Science Fiction, French Poetry etc.)")
-    
-    def __str__(self):
-        """
-        String for representing the Model object (in Admin site etc.)
-        """
-        return self.name
-
-class Book(models.Model):
-    """
-    Model representing a book (but not a specific copy of a book).
-    """
-    title = models.CharField(max_length=200)
-    author = models.ForeignKey('Author', on_delete=models.SET_NULL, null=True)
-    # Foreign Key used because book can only have one author, but authors can have multiple books
-    # Author as a string rather than object because it hasn't been declared yet in the file.
-    summary = models.TextField(max_length=1000, help_text="Enter a brief description of the book")
-    isbn = models.CharField('ISBN',max_length=13, help_text='13 Character <a href="https://www.isbn-international.org/content/what-isbn">ISBN number</a>')
-    genre = models.ManyToManyField(Genre, help_text="Select a genre for this book")
-    # ManyToManyField used because genre can contain many books. Books can cover many genres.
-    # Genre class has already been defined so we can specify the object above.
-    
-    def __str__(self):
-        """
-        String for representing the Model object.
-        """
-        return self.title
-    
-    
-    def get_absolute_url(self):
-        """
-        Returns the url to access a particular book instance.
-        """
-        return reverse('book-detail', args=[str(self.id)])
-
-import uuid # Required for unique book instances
-
-class BookInstance(models.Model):
-    """
-    Model representing a specific copy of a book (i.e. that can be borrowed from the library).
-    """
-    id = models.UUIDField(primary_key=True, default=uuid.uuid4, help_text="Unique ID for this particular book across whole library")
-    book = models.ForeignKey('Book', on_delete=models.SET_NULL, null=True) 
-    imprint = models.CharField(max_length=200)
-    due_back = models.DateField(null=True, blank=True)
-   
-   
-    LOAN_STATUS = (
-        ('m', 'Maintenance'),
-        ('o', 'On loan'),
-        ('a', 'Available'),
-        ('r', 'Reserved'),
-    )
-
-    status = models.CharField(max_length=1, choices=LOAN_STATUS, blank=True, default='m', help_text='Book availability')
-
-    def __str__(self):
-        """
-        String for representing the Model object
-        """
-        return '%s (%s)' % (self.id,self.book.title)
-
-class Author(models.Model):
-    """
-    Model representing an author.
-    """
-    first_name = models.CharField(max_length=100)
-    last_name = models.CharField(max_length=100)
-    date_of_birth = models.DateField(null=True, blank=True)
-    date_of_death = models.DateField('Died', null=True, blank=True)
-    
-    def get_absolute_url(self):
-        """
-        Returns the url to access a particular author instance.
-        """
-        return reverse('author-detail', args=[str(self.id)])
-    
-
-    def __str__(self):
-        """
-        String for representing the Model object.
-        """
-        return '%s, %s' % (self.last_name, self.first_name)

+ 0 - 5
app/catalog/static/css/styles.css

@@ -1,5 +0,0 @@
-.sidebar-nav {
-    margin-top: 20px;
-    padding: 0;
-    list-style: none;
-}

+ 0 - 45
app/catalog/templates/base_generic.html

@@ -1,45 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-<head>
-  
-  {% block title %}<title>Local Library</title>{% endblock %}
-  <meta charset="utf-8">
-  <meta name="viewport" content="width=device-width, initial-scale=1">
-  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
-  <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
-  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
-  
-  <!-- Добавление дополнительного статического CSS файла -->
-  {% load static %}
-  <link rel="stylesheet" href="{% static 'css/styles.css' %}">
-</head>
-
-<body>
-
-  <div class="container-fluid">
-
-    <div class="row">
-      <div class="col-sm-2">
-      {% block sidebar %}
-      <ul class="sidebar-nav">
-          <li><a href="{% url 'index' %}">Home</a></li>
-          <li><a href="{% url 'books' %}">All books</a></li>
-          <li><a href="">All authors</a></li>
-	  {% if user.is_authenticated %}
-          <li>User: {{ user.get_username }}</li>
-	  <li><a href="{% url 'my-borrowed' %}">My Borrowed</a></li>
-          <li><a href="{% url 'logout'%}?next={{request.path}}">Logout</a></li>   
-          {% else %}
-          <li><a href="{% url 'login'%}?next={{request.path}}">Login</a></li>   
-          {% endif %} 
-      </ul>
-     {% endblock %}
-      </div>
-      <div class="col-sm-10 ">
-      {% block content %}{% endblock %}
-      </div>
-    </div>
-
-  </div>
-</body>
-</html>

+ 0 - 1
app/catalog/templates/catalog/GetFace.py

@@ -1 +0,0 @@
-

+ 0 - 14
app/catalog/templates/catalog/author_confirm_delete.html

@@ -1,14 +0,0 @@
-{% extends "base_generic.html" %}
-
-{% block content %}
-
-<h1>Delete</h1>
-
-<p>Are you sure you want to delete: {{ author }}?</p>
-
-<form action="" method="POST">
-  {% csrf_token %}
-  <input type="submit" action="" value="Yes, delete." />
-</form>
-
-{% endblock %}

+ 0 - 13
app/catalog/templates/catalog/author_form.html

@@ -1,13 +0,0 @@
-{% extends "base_generic.html" %}
-
-{% block content %}
-
-<form action="" method="post">
-    {% csrf_token %}
-    <table>
-    {{ form.as_table }}
-    </table>
-    <input type="submit" value="Submit" />
-    
-</form>
-{% endblock %}

+ 0 - 23
app/catalog/templates/catalog/book_detail.html

@@ -1,23 +0,0 @@
-{% extends "base_generic.html" %}
-
-{% block content %}
-  <h1>Title: {{ book.title }}</h1>
-
-  <p><strong>Author:</strong> <a href="">{{ book.author }}</a></p> <!-- author detail link not yet defined -->
-  <p><strong>Summary:</strong> {{ book.summary }}</p>
-  <p><strong>ISBN:</strong> {{ book.isbn }}</p> 
-  <p><strong>Language:</strong> {{ book.language }}</p>  
-  <p><strong>Genre:</strong> {% for genre in book.genre.all %} {{ genre }}{% if not forloop.last %}, {% endif %}{% endfor %}</p>  
-
-  <div style="margin-left:20px;margin-top:20px">
-    <h4>Copies</h4>
-
-    {% for copy in book.bookinstance_set.all %}
-    <hr>
-    <p class="{% if copy.status == 'a' %}text-success{% elif copy.status == 'd' %}text-danger{% else %}text-warning{% endif %}">{{ copy.get_status_display }}</p>
-    {% if copy.status != 'a' %}<p><strong>Due to be returned:</strong> {{copy.due_back}}</p>{% endif %}
-    <p><strong>Imprint:</strong> {{copy.imprint}}</p>
-    <p class="text-muted"><strong>Id:</strong> {{copy.id}}</p>
-    {% endfor %}
-  </div>
-{% endblock %}

+ 0 - 19
app/catalog/templates/catalog/book_list.html

@@ -1,19 +0,0 @@
-{% extends "base_generic.html" %}
-
-{% block content %}
-    <h1>Book List</h1>
-
-    {% if book_list %}
-    <ul>
-
-      {% for book in book_list %}
-      <li>
-        <a href="{{ book.get_absolute_url }}">{{ book.title }}</a> ({{book.author}})
-      </li>
-      {% endfor %}
-
-    </ul>
-    {% else %}
-      <p>There are no books in the library.</p>
-    {% endif %}       
-{% endblock %}

+ 0 - 23
app/catalog/templates/catalog/book_renew_librarian.html

@@ -1,23 +0,0 @@
-{% extends "base_generic.html" %}
-{% block content %}
-
-    <h1>Renew: {{bookinst.book.title}}</h1>
-    <p>Borrower: {{bookinst.borrower}}</p>
-    <p{% if bookinst.is_overdue %} class="text-danger"{% endif %}>Due date: {{bookinst.due_back}}</p>
-    
-    <form action="" method="post">
-        {% csrf_token %}
-        <table>
-        <tr>
-          <th><label for="id_renewal_date">Renewal date:</label></th>
-          <td>
-            <input id="id_renewal_date" name="renewal_date" type="text" value="2016-11-08" required />
-            <br />
-            <span class="helptext">Enter date between now and 4 weeks (default 3 weeks).</span>
-          </td>
-        </tr>
-        </table>
-        <input type="submit" value="Submit" />
-    </form>
-
-{% endblock %}

+ 0 - 19
app/catalog/templates/catalog/bookinstance_list_borrowed_user.html

@@ -1,19 +0,0 @@
-{% extends "base_generic.html" %}
-
-{% block content %}
-    <h1>Borrowed books</h1>
-
-    {% if bookinstance_list %}
-    <ul>
-
-      {% for bookinst in bookinstance_list %} 
-      <li class="{% if bookinst.is_overdue %}text-danger{% endif %}">
-        <a href="{% url 'book-detail' bookinst.book.pk %}">{{bookinst.book.title}}</a> ({{ bookinst.due_back }})        
-      </li>
-      {% endfor %}
-    </ul>
-
-    {% else %}
-      <p>There are no books borrowed.</p>
-    {% endif %}       
-{% endblock %}

+ 0 - 16
app/catalog/templates/getface.html

@@ -1,16 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-    <meta charset="utf-8" />
-    <title>GetFace function</title>
-</head>
-<body>
-    <form method="POST">
-        {% csrf_token %}
-    <table>
-        {{ form }}
-    </table>
-    <input type="submit" value="Submit" />
-</form>
-</body>
-</html>

+ 0 - 19
app/catalog/templates/index.html

@@ -1,19 +0,0 @@
-{% extends "base_generic.html" %}
-
-{% block content %}
-<h1>Local Library Home</h1>
-
-  <p>Welcome to <em>LocalLibrary</em>, a very basic Django website developed as a tutorial example on the Mozilla Developer Network.</p>
-
-<h2>Dynamic content</h2>
-
-  <p>The library has the following record counts:</p>
-  <ul>
-    <li><strong>Books:</strong> {{ num_books }}</li>
-    <li><strong>Copies:</strong> {{ num_instances }}</li>
-    <li><strong>Copies available:</strong> {{ num_instances_available }}</li>
-    <li><strong>Authors:</strong> {{ num_authors }}</li>
-  </ul>
-  <p>You have visited this page {{ num_visits }}{% if num_visits == 1 %} time{% else %} times{% endif %}.</p>
-
-{% endblock %}

+ 0 - 3
app/catalog/tests.py

@@ -1,3 +0,0 @@
-from django.test import TestCase
-
-# Create your tests here.

+ 0 - 39
app/catalog/urls.py

@@ -1,39 +0,0 @@
-from django.urls import path
-from . import views
-
-urlpatterns = [
-
-]
-
-urlpatterns = [
-    path('', views.index, name='index'),
-    path('admin/', admin.site.urls),
-    path('', views.getformular, name='getformular'),
-]
-
-from django.urls import path
-from . import views
-from django.conf.urls import url
-
-urlpatterns = [
-    url(r'^$', views.index, name='index'),
-    url(r'^$', views.getformular, name='getformular'),
-    url(r'^books/$', views.BookListView.as_view(), name='books'),
-    url(r'^book/(?P<pk>\d+)$', views.BookDetailView.as_view(), name='book-detail'),
-]
-
-urlpatterns += [   
-    url(r'^book/(?P<pk>[-\w]+)/renew/$', views.renew_book_librarian, name='renew-book-librarian'),
-]
-
-urlpatterns += [   
-    url(r'^mybooks/$', views.LoanedBooksByUserListView.as_view(), name='my-borrowed'),
-]
-
-urlpatterns += [  
-    url(r'^author/create/$', views.AuthorCreate.as_view(), name='author_create'),
-    url(r'^author/(?P<pk>\d+)/update/$', views.AuthorUpdate.as_view(), name='author_update'),
-    url(r'^author/(?P<pk>\d+)/delete/$', views.AuthorDelete.as_view(), name='author_delete'),
-]
-
-

+ 0 - 148
app/catalog/views.py

@@ -1,148 +0,0 @@
-from django.shortcuts import render
-
-# Create your views here.
-from django.contrib.auth.decorators import permission_required
-
-from .models import Book, Author, BookInstance, Genre
-
-def index(request):
-    num_books=Book.objects.all().count()
-    num_instances=BookInstance.objects.all().count()
-    num_instances_available=BookInstance.objects.filter(status__exact='a').count()
-    num_authors=Author.objects.count() 
-    num_visits=request.session.get('num_visits', 0)
-    request.session['num_visits'] = num_visits+1
-    
-    return render(
-        request,
-        'index.html',
-        context={'num_books':num_books,'num_instances':num_instances,'num_instances_available':num_instances_available,'num_authors':num_authors,'num_visits':num_visits},
-    )
-
-
-from django.shortcuts import get_object_or_404
-from django.http import HttpResponseRedirect
-from django.urls import reverse
-import datetime
-
-from .forms import RenewBookForm
-
-@permission_required('catalog.can_mark_returned')
-def renew_book_librarian(request, pk):
-    """
-    View function for renewing a specific BookInstance by librarian
-    """
-    book_inst=get_object_or_404(BookInstance, pk = pk)
-
-    # If this is a POST request then process the Form data
-    if request.method == 'POST':
-
-        # Create a form instance and populate it with data from the request (binding):
-        form = RenewBookForm(request.POST)
-
-        # Check if the form is valid:
-        if form.is_valid():
-            # process the data in form.cleaned_data as required (here we just write it to the model due_back field)
-            book_inst.due_back = form.cleaned_data['renewal_date']
-            book_inst.save()
-
-            # redirect to a new URL:
-            return HttpResponseRedirect(reverse('all-borrowed') )
-
-    # If this is a GET (or any other method) create the default form.
-    else:
-        proposed_renewal_date = datetime.date.today() + datetime.timedelta(weeks=3)
-        form = RenewBookForm(initial={'renewal_date': proposed_renewal_date,})
-
-    return render(request, 'catalog/book_renew_librarian.html', {'form': form, 'bookinst':book_inst})
-
-from django.views import generic
-
-class BookListView(generic.ListView):
-    model = Book
-
-class BookDetailView(generic.DetailView):
-    model = Book
-
-
-
-from django.contrib.auth.mixins import LoginRequiredMixin
-
-class LoanedBooksByUserListView(LoginRequiredMixin,generic.ListView):
-    """
-    Generic class-based view listing books on loan to current user. 
-    """
-    model = BookInstance
-    template_name ='catalog/bookinstance_list_borrowed_user.html'
-    paginate_by = 10
-    
-    def get_queryset(self):
-        return BookInstance.objects.filter(borrower=self.request.user).filter(status__exact='o').order_by('due_back')
-
-from django.contrib.auth.decorators import permission_required
-
-from django.shortcuts import get_object_or_404
-from django.http import HttpResponseRedirect
-from django.urls import reverse
-import datetime
-
-from .forms import RenewBookForm
-
-@permission_required('catalog.can_mark_returned')
-def renew_book_librarian(request, pk):
-    """
-    View function for renewing a specific BookInstance by librarian
-    """
-    book_inst=get_object_or_404(BookInstance, pk = pk)
-
-    # If this is a POST request then process the Form data
-    if request.method == 'POST':
-
-        # Create a form instance and populate it with data from the request (binding):
-        form = RenewBookForm(request.POST)
-
-        # Check if the form is valid:
-        if form.is_valid():
-            # process the data in form.cleaned_data as required (here we just write it to the model due_back field)
-            book_inst.due_back = form.cleaned_data['renewal_date']
-            book_inst.save()
-
-            # redirect to a new URL:
-            return HttpResponseRedirect(reverse('all-borrowed') )
-
-    # If this is a GET (or any other method) create the default form.
-    else:
-        proposed_renewal_date = datetime.date.today() + datetime.timedelta(weeks=3)
-        form = RenewBookForm(initial={'renewal_date': proposed_renewal_date,})
-
-    return render(request, 'catalog/book_renew_librarian.html', {'form': form, 'bookinst':book_inst})
-
-from django.views.generic.edit import CreateView, UpdateView, DeleteView
-from django.urls import reverse_lazy
-from .models import Author
-
-class AuthorCreate(CreateView):
-    model = Author
-    fields = '__all__'
-    initial={'date_of_death':'12/10/2016',}
-
-class AuthorUpdate(UpdateView):
-    model = Author
-    fields = ['first_name','last_name','date_of_birth','date_of_death']
-
-class AuthorDelete(DeleteView):
-    model = Author
-    success_url = reverse_lazy('authors')
-
-from django.shortcuts import render
-from .forms import UserForm
- 
-def index(request):
-    if request.method == "POST":
-        name = request.POST.get("name")
-        return HttpResponse("<h2>Hello, {0}</h2>".format(name))
-    else:
-        userform = UserForm()
-        return render(request, "getface.html", {"form": userform})
-
-

+ 9 - 17
app/forms.py

@@ -1,19 +1,11 @@
-# -*- coding: utf-8 -*-
-"""
-Definition of forms.
-"""
-
 from django import forms
-from django.contrib.auth.forms import AuthenticationForm
-from django.utils.translation import ugettext_lazy as _
 
-class BootstrapAuthenticationForm(AuthenticationForm):
-    """Authentication form which uses boostrap CSS."""
-    username = forms.CharField(max_length=254,
-                               widget=forms.TextInput({
-                                   'class': 'form-control',
-                                   'placeholder': 'User name'}))
-    password = forms.CharField(label=_("Password"),
-                               widget=forms.PasswordInput({
-                                   'class': 'form-control',
-                                   'placeholder':'Password'}))
+class ContactForm(forms.Form):
+    firstname = forms.CharField(required=False, label='Имя')
+    surname = forms.CharField(required=True, label='Фамилия*')
+    middlename = forms.CharField(required=False, label='Отчество')
+    uid = forms.IntegerField(required=False)
+
+    def send_email(self):
+        # send email using the self.cleaned_data dictionary
+        pass

BIN
app/forms.pyc


+ 0 - 1
app/migrations/__init__.py

@@ -1 +0,0 @@
-

BIN
app/migrations/__init__.pyc


BIN
app/migrations/__pycache__/__init__.cpython-35.pyc


BIN
app/migrations/__pycache__/__init__.cpython-36.pyc


+ 0 - 8
app/models.py

@@ -1,8 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
-Definition of models.
-"""
-
-from django.db import models
-
-# Create your models here.

BIN
app/models.pyc


+ 0 - 39
app/scripts/GetFormular.py

@@ -1,39 +0,0 @@
-def GetFormular(host, api, api_key, surname, uid = 0, firstname = '0', middlename = '0'):
-    import json
-    import requests 
-    url = ''.join([str(host), str(api), 'api_key=', str(api_key)]) 
-    response = requests.get(url) 
-    data = response.json() 
-    if uid == '':
-        uid = 0
-    else:
-        uid = int(uid)
-    if firstname == '':
-        firstname = '0'
-    if middlename == '':
-        middlename = '0'
-    surname = str(surname)
-    assert isinstance(uid, int), 'EmpGUID  should be an int'
-    assert isinstance(surname, str) and surname.isspace() != True, 'surname should be a non-space string'
-    assert isinstance(surname, str) and surname, 'Введите фамилию сотрудника'
-    assert isinstance(firstname, str) and firstname.isspace() != True, 'firstname should be a non-space string'
-    assert isinstance(middlename, str) and middlename.isspace() != True, 'middlename should be a non-space string'
-    ### Валидация
-    formular = [] # пустой список для добавления найденных результатов
-    main_cond = "f['SurName'] == surname" # главное условие поиска
-    name_params = ["f['EmpGUID']", "f['FirstName']", "f['MiddleName']"] # имена параметров в json
-    params = [str(uid), str(firstname), str(middlename)] # список передаваемых параметров
-    conditions = [] # пустой список для дополнительный условий поиска
-    for i in range(len(params)):
-        if params[i] != str(0):
-            conditions.append('and str({}) == "{}"'.format(name_params[i], params[i].strip()))
-    other_cond = ' '.join([x for x in conditions])
-    search = main_cond + ' ' + other_cond
-    print(search)
-    for f in data: # цикл поиска по каждому элементу списка в data
-        if eval(search): # условие поиска
-            formular.append(f) # добавляем найденные данные в список
-    with open('formular.json', 'w') as write_file: # создание пустого файла для записи
-        json.dump(formular, write_file) # запись найденного содержимого в json файл
-    if len(formular) == 0: # обработка исключений
-        print('Сотрудник не найден') # вывод сообщения в случае отсутствия совпадений

BIN
app/scripts/__pycache__/GetFormular.cpython-35.pyc


File diff suppressed because it is too large
+ 0 - 6816
app/static/app/content/bootstrap.css


File diff suppressed because it is too large
+ 0 - 20
app/static/app/content/bootstrap.min.css


+ 0 - 42
app/static/app/content/site.css

@@ -1,42 +0,0 @@
-body {
-    padding-top: 50px;
-    padding-bottom: 20px;
-}
-
-/* Set padding to keep content from hitting the edges */
-.body-content {
-    padding-left: 15px;
-    padding-right: 15px;
-}
-
-/* Set width on the form input elements since they're 100% wide by default */
-input,
-select,
-textarea {
-    max-width: 280px;
-}
-
-/* styles for validation helpers */
-.field-validation-error {
-    color: #b94a48;
-}
-
-.field-validation-valid {
-    display: none;
-}
-
-input.input-validation-error {
-    border: 1px solid #b94a48;
-}
-
-input[type="checkbox"].input-validation-error {
-    border: 0 none;
-}
-
-.validation-summary-errors {
-    color: #b94a48;
-}
-
-.validation-summary-valid {
-    display: none;
-}

BIN
app/static/app/fonts/glyphicons-halflings-regular.eot


File diff suppressed because it is too large
+ 0 - 228
app/static/app/fonts/glyphicons-halflings-regular.svg


+ 0 - 0
app/static/app/fonts/glyphicons-halflings-regular.ttf


Some files were not shown because too many files changed in this diff