-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathProgram.fs
More file actions
51 lines (36 loc) · 1.08 KB
/
Program.fs
File metadata and controls
51 lines (36 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
// Learn more about F# at http://docs.microsoft.com/dotnet/fsharp
module Program
open System
open System.Collections.Generic
open Fable.Core
open Fable.Python
open Fable.Core.PyInterop
type ISettings =
[<Emit("$0.configure(DEBUG=$1, ROOT_URLCONF=$2)")>]
abstract configure : DEBUG: bool * ROOT_URLCONF : obj -> unit
[<ImportMember("django.conf")>]
let settings: ISettings = nativeOnly
type IPath =
abstract path : url: string * view: obj -> obj
[<ImportMember("django")>]
let urls: IPath = nativeOnly
[<ImportMember("django.http")>]
let HttpResponse: string -> obj = nativeOnly
[<ImportMember("django.core.management")>]
let execute_from_command_line: string [] -> int = nativeOnly
[<ImportAll("sys")>]
let sys : obj = nativeOnly
[<Emit("sys.modules[__name__]")>]
let sysModules : unit -> obj = nativeOnly
settings.configure (
DEBUG=true,
ROOT_URLCONF = sysModules
)
let index request =
HttpResponse("<h1>A minimal Django response!</h1>")
let urlpatterns = [|
urls.path ("",index)
|]
[<EntryPoint>]
let main argv =
execute_from_command_line (sys?argv)