Skip to content

Commit

Permalink
move server code to server directory
Browse files Browse the repository at this point in the history
  • Loading branch information
georgelwalker committed Apr 20, 2017
1 parent 4c19780 commit fc0816b
Show file tree
Hide file tree
Showing 74 changed files with 4,967 additions and 128 deletions.
196 changes: 196 additions & 0 deletions TFRS.pyproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,196 @@
<?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>tfrs</Name>
<RootNamespace>TFRS</RootNamespace>
<DjangoSettingsModule>tfrs.settings</DjangoSettingsModule>
</PropertyGroup>
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>8cd6548c-8c38-4840-8d8f-d0dfd66699ee</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>..\tfrs</SearchPath>
<WorkingDirectory>.</WorkingDirectory>
<WebBrowserUrl>http://localhost</WebBrowserUrl>
<LaunchProvider>Django launcher</LaunchProvider>
<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="manage.py" />
<Compile Include="server\database.py" />
<Compile Include="server\migrations\0001_initial.py" />
<Compile Include="server\migrations\0002_auto_20170214_1526.py" />
<Compile Include="server\migrations\0003_auto_20170419_1214.py" />
<Compile Include="server\migrations\__init__.py" />
<Compile Include="server\models\Attachment.py" />
<Compile Include="server\models\AttachmentViewModel.py" />
<Compile Include="server\models\Audit.py" />
<Compile Include="server\models\CompliancePeriod.py" />
<Compile Include="server\models\Contact.py" />
<Compile Include="server\models\CreditTrade.py" />
<Compile Include="server\models\CreditTradeLogEntry.py" />
<Compile Include="server\models\CurrentUserViewModel.py" />
<Compile Include="server\models\FuelSupplier.py" />
<Compile Include="server\models\Group.py" />
<Compile Include="server\models\GroupMembership.py" />
<Compile Include="server\models\GroupMembershipViewModel.py" />
<Compile Include="server\models\GroupViewModel.py" />
<Compile Include="server\models\History.py" />
<Compile Include="server\models\HistoryViewModel.py" />
<Compile Include="server\models\LookupList.py" />
<Compile Include="server\models\Note.py" />
<Compile Include="server\models\Notification.py" />
<Compile Include="server\models\NotificationEvent.py" />
<Compile Include="server\models\NotificationViewModel.py" />
<Compile Include="server\models\Permission.py" />
<Compile Include="server\models\PermissionViewModel.py" />
<Compile Include="server\models\Role.py" />
<Compile Include="server\models\RolePermission.py" />
<Compile Include="server\models\RolePermissionViewModel.py" />
<Compile Include="server\models\RoleViewModel.py" />
<Compile Include="server\models\User.py" />
<Compile Include="server\models\UserDetailsViewModel.py" />
<Compile Include="server\models\UserFavourite.py" />
<Compile Include="server\models\UserFavouriteViewModel.py" />
<Compile Include="server\models\UserRole.py" />
<Compile Include="server\models\UserRoleViewModel.py" />
<Compile Include="server\models\UserViewModel.py" />
<Compile Include="server\models\__init__.py" />
<Compile Include="server\serializers.py" />
<Compile Include="server\test_api.py" />
<Compile Include="server\test_models.py" />
<Compile Include="server\urls.py" />
<Compile Include="server\views\Attachment.py" />
<Compile Include="server\views\CompliancePeriod.py" />
<Compile Include="server\views\Contact.py" />
<Compile Include="server\views\CreditTrade.py" />
<Compile Include="server\views\CreditTradeLogEntry.py" />
<Compile Include="server\views\CurrentUser.py" />
<Compile Include="server\views\FuelSupplier.py" />
<Compile Include="server\views\Group.py" />
<Compile Include="server\views\History.py" />
<Compile Include="server\views\LookupList.py" />
<Compile Include="server\views\Note.py" />
<Compile Include="server\views\Notification.py" />
<Compile Include="server\views\NotificationEvent.py" />
<Compile Include="server\views\Permission.py" />
<Compile Include="server\views\Role.py" />
<Compile Include="server\views\User.py" />
<Compile Include="server\views\__init__.py" />
<Compile Include="server\__init__.py" />
<Compile Include="tfrs\admin.py" />
<Compile Include="tfrs\database.py" />
<Compile Include="tfrs\settings.py" />
<Compile Include="tfrs\urls.py">
<SubType>Code</SubType>
</Compile>
<Compile Include="tfrs\views.py" />
<Compile Include="tfrs\__init__.py" />
<Compile Include="welcome\admin.py" />
<Compile Include="welcome\database.py" />
<Compile Include="welcome\models.py" />
<Compile Include="welcome\tests.py" />
<Compile Include="welcome\views.py" />
<Compile Include="welcome\__init__.py" />
<Compile Include="wsgi.py" />
</ItemGroup>
<ItemGroup>
<Content Include="requirements.txt" />
<Content Include="server\migrations\__pycache__\0001_initial.cpython-35.pyc" />
<Content Include="server\migrations\__pycache__\0002_auto_20170214_1526.cpython-35.pyc" />
<Content Include="server\migrations\__pycache__\0003_auto_20170419_1214.cpython-35.pyc" />
<Content Include="server\migrations\__pycache__\__init__.cpython-35.pyc" />
<Content Include="server\models\__pycache__\Attachment.cpython-35.pyc" />
<Content Include="server\models\__pycache__\AttachmentViewModel.cpython-35.pyc" />
<Content Include="server\models\__pycache__\Audit.cpython-35.pyc" />
<Content Include="server\models\__pycache__\CompliancePeriod.cpython-35.pyc" />
<Content Include="server\models\__pycache__\Contact.cpython-35.pyc" />
<Content Include="server\models\__pycache__\CreditTrade.cpython-35.pyc" />
<Content Include="server\models\__pycache__\FuelSupplier.cpython-35.pyc" />
<Content Include="server\models\__pycache__\History.cpython-35.pyc" />
<Content Include="server\models\__pycache__\Note.cpython-35.pyc" />
<Content Include="server\models\__pycache__\__init__.cpython-35.pyc" />
<Content Include="server\views\__pycache__\Attachment.cpython-35.pyc" />
<Content Include="server\views\__pycache__\CompliancePeriod.cpython-35.pyc" />
<Content Include="server\views\__pycache__\Contact.cpython-35.pyc" />
<Content Include="server\views\__pycache__\CreditTrade.cpython-35.pyc" />
<Content Include="server\views\__pycache__\CreditTradeLogEntry.cpython-35.pyc" />
<Content Include="server\views\__pycache__\CurrentUser.cpython-35.pyc" />
<Content Include="server\views\__pycache__\FuelSupplier.cpython-35.pyc" />
<Content Include="server\views\__pycache__\Group.cpython-35.pyc" />
<Content Include="server\views\__pycache__\History.cpython-35.pyc" />
<Content Include="server\views\__pycache__\LookupList.cpython-35.pyc" />
<Content Include="server\views\__pycache__\Note.cpython-35.pyc" />
<Content Include="server\views\__pycache__\Notification.cpython-35.pyc" />
<Content Include="server\views\__pycache__\NotificationEvent.cpython-35.pyc" />
<Content Include="server\views\__pycache__\Permission.cpython-35.pyc" />
<Content Include="server\views\__pycache__\Role.cpython-35.pyc" />
<Content Include="server\views\__pycache__\User.cpython-35.pyc" />
<Content Include="server\views\__pycache__\__init__.cpython-35.pyc" />
</ItemGroup>
<ItemGroup>
<Folder Include="server\" />
<Folder Include="server\migrations\" />
<Folder Include="server\migrations\__pycache__\" />
<Folder Include="server\models\" />
<Folder Include="server\models\__pycache__\" />
<Folder Include="server\views\" />
<Folder Include="server\views\__pycache__\" />
<Folder Include="welcome\" />
<Folder Include="tfrs\" />
</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>
22 changes: 22 additions & 0 deletions TFRS.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.26412.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{888888A0-9F3D-457C-B088-3A5042F75D52}") = "TFRS", "tfrs.pyproj", "{8CD6548C-8C38-4840-8D8F-D0DFD66699EE}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{8CD6548C-8C38-4840-8D8F-D0DFD66699EE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8CD6548C-8C38-4840-8D8F-D0DFD66699EE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8CD6548C-8C38-4840-8D8F-D0DFD66699EE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8CD6548C-8C38-4840-8D8F-D0DFD66699EE}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
11 changes: 10 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
django>=1.8,<1.9
django-debug-toolbar==1.5
gunicorn==19.4.5
psycopg2==2.6.1
psycopg2==2.7.1
whitenoise==3.0
django-extensions==1.7.7
djangorestframework==3.6.2
# Optional packages which may be used with REST framework.
markdown===2.6.8
django-filter===1.0.2
# documentation
django_rest_swagger===2.1.2
# packages for testing
pytest-django==3.1.2
pytest-cov==2.4.0
File renamed without changes.
29 changes: 29 additions & 0 deletions server/database.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import os

from django.conf import settings


engines = {
'sqlite': 'django.db.backends.sqlite3',
'postgresql': 'django.db.backends.postgresql_psycopg2',
'mysql': 'django.db.backends.mysql',
}


def config():
service_name = os.getenv('DATABASE_SERVICE_NAME', '').upper().replace('-', '_')
if service_name:
engine = engines.get(os.getenv('DATABASE_ENGINE'), engines['sqlite'])
else:
engine = engines['sqlite']
name = os.getenv('DATABASE_NAME')
if not name and engine == engines['sqlite']:
name = os.path.join(settings.BASE_DIR, 'db.sqlite3')
return {
'ENGINE': engine,
'NAME': name,
'USER': os.getenv('DATABASE_USER'),
'PASSWORD': os.getenv('DATABASE_PASSWORD'),
'HOST': os.getenv('{}_SERVICE_HOST'.format(service_name)),
'PORT': os.getenv('{}_SERVICE_PORT'.format(service_name)),
}
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
class Migration(migrations.Migration):

dependencies = [
('tfrs', '0001_initial'),
('server', '0001_initial'),
]

operations = [
Expand Down
Loading

0 comments on commit fc0816b

Please sign in to comment.