Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Oct 22 19:11

    essenciary on master

    Multiple servers and currenturl… (compare)

  • Oct 22 13:58

    essenciary on master

    Bulk assets config (compare)

  • Oct 22 13:49
    megatux starred GenieFramework/Genie.jl
  • Oct 22 01:23
    Pashio84 starred GenieFramework/Genie.jl
  • Oct 21 19:37

    essenciary on master

    initial cdn support cdn support cdn support and 2 more (compare)

  • Oct 21 00:05
    andyDoucette commented #420
  • Oct 21 00:03
    andyDoucette commented #420
  • Oct 20 19:45
    flowman74 starred GenieFramework/Genie.jl
  • Oct 20 13:06

    github-actions[bot] on v3.3.0

    (compare)

  • Oct 20 12:50
    JuliaTagBot commented #302
  • Oct 20 12:33
    JuliaRegistrator commented on fe27da1
  • Oct 20 12:33
    essenciary commented on fe27da1
  • Oct 20 12:32
    essenciary commented #420
  • Oct 20 04:48
    Shervi28 starred GenieFramework/Genie.jl
  • Oct 19 13:58
    chilledgeek starred GenieFramework/Genie.jl
  • Oct 19 07:34
    essenciary commented #425
  • Oct 19 03:25
    Shum88 commented #425
  • Oct 19 01:52
    SantosPereira starred GenieFramework/Genie.jl
  • Oct 18 15:09
    UniqueTokens opened #426
assessmentcoord
@assessmentcoord

Hello,
I am getting this error:

julia> include(joinpath("config", "initializers", "searchlight.jl"))
[ Info: 2021-09-24 12:09:33 Precompiling SearchLightSQLite [21a827c4-482a-11ea-3a19-4d2243a4a2c5]
ERROR: LoadError: LoadError: UndefVarError: PosLen not defined

Could someone please help me?

2 replies
Shum
@Shum88
@essenciary following 3 screen dump images files ...
1.) wpage.jl.html including \n
2.) function returning html and js code (including sLEd which is "\n"
3.) view source from web-browser (since \n is here ...so I can watch the page source more meaningfull ...) ... the 1st line which come from app.jl.html layout file (I already taken away the \n symbol ... so it is a long long line)
wpage.jl.htnl_001.jpg
_ACRukleJS_function_001.jpg
view_source_001.jpg
Ismael Venegas Castelló
@HarmonicaMuse
@Shum88 if you want to test if a variable is defined use @isdefined var
if you want to test if a defined variable points to nothing then isnothing(var)
julia> @isdefined var
false

julia> var = nothing

julia> isnothing(var)
true

julia> @isdefined var
true

julia> var = 42
42

julia> isnothing(var)
false
1 reply
there is not such var being nothing if undefined, like in javascript :shivers:
Karl Forner
@kforner
simple question, but I could not find any information: has anyone deployed Genie using keycloak ? Or what is the usual/standard way to manage authentication ? Thanks
2 replies
wishlistManCauseIneedU
@wishlistManCauseIneedU
I have a question, with genie can I make microservices and integrate docker?
wishlistManCauseIneedU
@wishlistManCauseIneedU
@kforner oauth? there could be a oauth julie library
3 replies
Shum
@Shum88

@essenciary I would like to build my own params() to further handle params as follow: (But fail...)
would you point me to right direction ...

using Genie.Router

export GetParams
function GetParams( xS::Params, xDef::Any )
xRet::Any = params( :xS )
if isnothing( xRet )
if !isnothing( xDef )
xRet = xDef
end
end
return xRet
end

8 replies
Fabio
@islerfab

@essenciary Thanks for all the work on this package - it's quite awesome for my purpose. I'd love to be able to debug it in VS Code, though, and that turns out to be quite a challenge. If I try to run bootstrap.jl as a Julia debug config, Genie throws an error when loading the routes. The server still starts and is accessible, but no Julia debugger is attached. When running the same command in a terminal, the server starts fine without an error message (that's why I guess it is related to the Julia Debugger).
I'm using Julia 1.6.3 and Genie 3.2.0. The error is the following:

ERROR: circular type parameter constraint in definition of #9#10
Stacktrace:
 [1] top-level scope
   @ none:0
 [2] top-level scope
   @ ~/dev/genie-test/Test/routes.jl:3
in expression starting at <...>/Test/routes.jl:3

My VS Code run config is the following:

{
      "type": "julia",
      "request": "launch",
      "name": "Run Genie Server",
      "program": "bootstrap.jl",
      "args": ["s"],
      "stopOnEntry": false,
      "cwd": "${workspaceFolder}",
      "juliaEnv": "${command:activeJuliaEnvironment}"
    }

Is VS Code debugging generally not (yet) supported, or is there a mistake on my end? It would make a huge difference for the development of a mid-site app to have a debugger available.

Thanks for your help!

3 replies
Daniel Russell-Brain
@killerfridge
Hi Guys, just trying to get started with Genie, running through the docs but coming up with this error when trying to connect to/create the SQLite db:
julia> include(joinpath("config", "initializers", "searchlight.jl"))
[ Info: 2021-10-04 16:30:13 Precompiling SearchLightSQLite [21a827c4-482a-11ea-3a19-4d2243a4a2c5]
ERROR: LoadError: LoadError: UndefVarError: PosLen not defined
Stacktrace:
  [1] top-level scope

...

┌ Error: 2021-10-04 16:30:19 ErrorException("Failed to precompile SearchLightSQLite [21a827c4-482a-11ea-3a19-4d2243a4a2c5] to C:\\Users\\DanielRussell-Brain\\.julia\\compiled\\v1.6\\SearchLightSQLite\\jl_E244.tmp.")
└ @ Main C:\Users\DanielRussell-Brain\OneDrive - KBRWyle\SimplifyMVC\Simplify\config\initializers\searchlight.jl:23

Any ideas on what's going wrong? I'm fairly new to Julia so error tracing is still a bit hit and miss for me!

Daniel Russell-Brain
@killerfridge
Bit more digging, seems to be an issue with the WeakRefStrings package, but I have no idea what to do about it
Daniel Russell-Brain
@killerfridge
Right, I've tried a fresh install of both Julia and Genie, and the same issue seems to persist
Adrian Salceanu
@essenciary
@killerfridge what versions? what os?
5 replies
I've been runnign SearchLightSQLite on Win and macOS, no issues
Shum
@Shum88

@essenciary I found that if the julia reserved key word "end" is missing ...following comes out:
ERROR: LoadError: syntax: incomplete: "module" at D:\10\julia\project\Pvpms\app\resources_jsajaxs_JsajaxsController.jl:1 requires end

However, there are over 2 thousands julia code lines inside the julia file (controller file) ... It is difficult to find out where the "end" is missing ??

missing_end_error_001.jpg
Adrian Salceanu
@essenciary
@Shum88 I don't know... is it? :)
depends on what you put in there - there could be hundreds of end closing functions, structs, submodules, etc
2 replies
sounds like the 2k lines are more of the problem - that sounds like a lot for a controller. maybe you should move code into models and/or external modules to make it easier to maintain and debug
aviadb
@aviadb
Hello. Is there a tutorial or example of how to work with MySQL/MariaDB?
1 reply
Shum
@Shum88
mysql_connection.yml.jpg
6 replies

@aviadb following the MVC (Watchtonight ) example wiht Genie, Choice 2) MySQL as db connector anf above is the db connection.yml setting, ... if any problem ... try to do Watchtonight again...of cause ... You need to setup MySQL with your owned username and password and set it as above screen dump example

https://genieframework.github.io/Genie.jl/dev/tutorials/4-1--Developing_MVC_Web_Apps.html

aviadb
@aviadb
Are there any open source projects based on Genie framework where I can see good practice techniques and learn from?
1 reply
Shum
@Shum88
@essenciary any Genie function for obtaining remote (client side) ip, web-browser info ?
3 replies
Louis Hoo
@LouisHoo5227

Hi guys, I am just started learning the genie.jl follow this documentation:

https://genieframework.github.io/Genie.jl/dev/tutorials/4-1--Developing_MVC_Web_Apps.html

I stuck at the "seeding the data" part as when I run seed() in the command line, it comes out error

ERROR: MethodError: Cannot convert an object of type PosLenString to an object of type
Int64 Int64
Closest candidates are:
convert(::Type{T}, ::Ptr) where T<:Integer at pointer.jl:23
convert(::Type{T}, ::Base.TwicePrecision) where T<:Number at twiceprecision.jl:250
convert(::Type{T}, ::AbstractChar) where T<:Number at char.jl:180
...
Stacktrace:
[1] setproperty!(x::Movie, f::Symbol, v::PosLenString)
@ Base .\Base.jl:34
[2] seed()
@ Main C:\Users\x_tao\Desktop\Julia\Watchtonight\db\seeds\seed_movies.jl:17
[3] top-level scope

@ REPL[27]:1

I followed all the steps above but I still get this error, may I know how should I fix this?

5 replies
Daniel Stevenson
@dms449

SearchLight Relationships

I'm having the User from GenieAuthentication reference a Person with a an id. Which of these is the correct way of doing it? What does DbId() do?

option1

Base.@kwdef mutable struct User <: AbstractModel
  ### FIELDS
  id::DbId = DbId()
  person_id::DbId = DbId()
  username::String = ""
  password::String = ""
end

or option2

Base.@kwdef mutable struct User <: AbstractModel
  ### FIELDS
  id::DbId = DbId()
  person_id::Int = 0
  username::String = ""
  password::String = ""
end
8 replies
Also, I'm having trouble understanding how SearchLight does relationships. If there's any docs on that specifically that would be helpful.
Shum
@Shum88

@essenciary following error code ... do not know where is the error ?

┌ Error: 2021-10-13 00:36:11 LoadError: syntax: cannot juxtapose string literal
│ Stacktrace:
│ [1] top-level scope
│ @ C:\Users\wcshu\AppData\Local\Temp\jl_genie_build_TVpZJC\GenieViews\ba601d479a25d12fd49bba4e9101d9d60be94305.jl:167
│ [2] include
│ @ .\Base.jl:386 [inlined]
│ [3] get_template(path::String; partial::Bool, context::Module, vars::Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
│ @ Genie.Renderer.Html C:\Users\wcshu.julia\packages\Genie\cUcHi\src\renderers\Html.jl:248
│ [4] template(path::String; partial::Bool, context::Module, vars::Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
│ @ Genie.Renderer.Html C:\Users\wcshu.julia\packages\Genie\cUcHi\src\renderers\Html.jl:698
│ [5] #partial#31
│ @ C:\Users\wcshu.julia\packages\Genie\cUcHi\src\renderers\Html.jl:684 [inlined]
│ [6] (::SyssystemsettingsController.var"#2#4"{Module})()
│ @ SyssystemsettingsController C:\Users\wcshu\AppData\Local\Temp\jl_genie_build_TVpZJC\GenieViews\12f5ae45a2a852c89c85859090944b83f711a945.jl:10
│ [7] #invokelatest#2
│ @ .\essentials.jl:708 [inlined]
│ [8] invokelatest
│ @ .\essentials.jl:706 [inlined]
│ [9] normal_element(f::Function, elem::String, args::Vector{Any}, attrs::Vector{Pair{Symbol, Any}})
│ @ Genie.Renderer.Html C:\Users\wcshu.julia\packages\Genie\cUcHi\src\renderers\Html.jl:64
│ [10] #p#169
│ @ .\none:2 [inlined]
│ [11] p
│ @ .\none:2 [inlined]
│ [12] func_12f5ae45a2a852c89c85859090944b83f711a945(; context::Module, oCtrl::Module, oModule::Module)
│ @ SyssystemsettingsController C:\Users\wcshu\AppData\Local\Temp\jl_genie_build_TVpZJC\GenieViews\12f5ae45a2a852c89c85859090944b83f711a945.jl:5
│ [13] func_12f5ae45a2a852c89c85859090944b83f711a945()
│ @ SyssystemsettingsController C:\Users\wcshu\AppData\Local\Temp\jl_genie_build_TVpZJC\GenieViews\12f5ae45a2a852c89c85859090944b83f711a945.jl:5
│ [14] (::SyssystemsettingsController.var"#10#14")()
│ @ SyssystemsettingsController C:\Users\wcshu\AppData\Local\Temp\jl_genie_build_TVpZJC\GenieViews\508d1b6e4a750b1df76ee23a52bb963454451b22.jl:51
│ [15] #invokelatest#2
│ @ .\essentials.jl:708 [inlined]
│ [16] invokelatest
│ @ .\essentials.jl:706 [inlined]
│ [17] normal_element(f::Function, elem::String, args::Vector{Any}, attrs::Vector{Pair{Symbol, Any}})
│ @ Genie.Renderer.Html C:\Users\wcshu.julia\packages\Genie\cUcHi\src\renderers\Html.jl:64
│ [18] #body#61
│ @ .\none:2 [inlined]
│ [19] body
│ @ .\none:2 [inlined]
│ [20] (::SyssystemsettingsController.var"#7#11")()
│ @ SyssystemsettingsController C:\Users\wcshu\AppData\Local\Temp\jl_genie_build_TVpZJC\GenieViews\508d1b6e4a750b1df76ee23a52bb963454451b22.jl:9
│ [21] #invokelatest#2
│ @ .\essentials.jl:708 [inlined]
│ [22] invokelatest
│ @ .\essentials.jl:706 [inlined]
│ [23] normal_element(f::Function, elem::String, args::Vector{Any}, attrs::Vector{Pair{Symbol, Any}})
│ @ Genie.Renderer.Html C:\Users\wcshu.julia\packages\Genie\cUcHi\src\renderers\Html.jl:64
│ [24] #html#53
│ @ .\none:2 [inlined]
│ [25] func_508d1b6e4a750b1df76ee23a52bb963454451b22(; context::Module, oCtrl::Module, oModule::Module)
│ @ SyssystemsettingsController C:\Users\wcshu\AppData\Local\Temp\jl_genie_build_TVpZJC\GenieViews\508d1b6e4a750b1df76ee23a52bb963454451b22.jl:5
│ [26] func_508d1b6e4a750b1df76ee23a52bb963454451b22()
│ @ SyssystemsettingsController C:\Users\wcshu\AppData\Local\Temp\jl_genie_build_TVpZJC\GenieViews\508d1b6e4a750b1df76ee23a52bb963454451b22.jl:5
│ [27] #invokelatest#2
│ @ .\essentials.jl:708 [inlined]
│ [28] invokelatest
│ @ .\essentials.jl:706 [inlined]
│ [29] Genie.Renderer.WebRenderable(::typeof(SyssystemsettingsController.func_508d1b6e4a750b1df76ee23a52bb963454451b22))
│ @ Genie.Renderer C:\Users\wcshu.julia\packages\Genie\cUcHi\src\Renderer.jl:162
│ [30] |>(x::Function, f::Type{Genie.Renderer.WebRenderable})
│ @ Base .\operators.jl:858
│ [31] render(::Ty

4 replies
Daniel Stevenson
@dms449
What's the appropriate way to run an app in "test" or "prod" mode?
11 replies
Shum
@Shum88
@essenciary Is there a function can return REQUEST_SCHEME ie.( "http" or "https") ?
Arsh Sharma
@sov_trotter:matrix.org
[m]
Hello folks. Is there a sample repo/connection.yml for PostgreSQL based apps??
Daniel Stevenson
@dms449
It would be great if GenieAuthentication automatically redirected a successful login to the originally requested page. I was about to open a feature request on that but I thought I would ask if anyone else knew how to do this and if it is already implemented and I just haven't figured it out.
Thans
6 replies
Shum
@Shum88
@dms449 here may help ...(my way)
AuthenticationController.jl.jpg
HomesController.jl and index.jl.html.jpg
Daniel Stevenson
@dms449

@Shum88 I know how to redirect to a different URL.

I would like to intercept and store the originally requested URL (before authentication) and store in the session (I guess). Then, on success, I could redirect to whichever page was originally requested. I'm just not sure yet how to get originally requested URL from inside the AuthenticationController.

Adrian Salceanu
@essenciary
the way it's implemented in other frameworks is that upon redirecting, the current URL is captured and sent as a GET param
something likeredirect("login?original_page=/users/10/delete")
this should work too (but needs testing)
Adrian Salceanu
@essenciary
redirect(:show_login; extra_query = Dict("original_page" => "/users/10/delete")
and we need to see how to easily retrieve the current URL
can't remember if there's a function
ideally we don't want do build it back from params(:controller), params(:action), ...
Daniel Stevenson
@dms449
@essenciary I will create a feature request and see what I can do. Its a good opportunity for me to dive into the code a bit more anwyways :)