Closed youpsla closed 1 year ago
Not enough clear. I'll reopen it later with better explained question(s).
Using view.render()
returns a string so you should be able to just use it like any other response in django.
import enaml
from django.http import HttpResponse
with enaml.imports():
from views import IndexView
def index(request):
view = IndexView(request=request)
return HttpResponse(view.render())
As usual great answer. Thanks a lots. I'll give it a try next week.
@youpsla just wondering if you have a Hello World example that uses Django and Enaml?
Hello @danieljfarrell . haven't had time to do it (new job !!!). When I have spare time, will be my first task.....
That would be great!
with enaml.imports(): from views import IndexView
Hi. It's a long time ....
Tried the solution in a docker container. Got an issue with
with enaml.imports():
from views import IndexView
It raise an import error.
My views
file is a file named views.enaml
, it's an enaml file not a py one.
I tried to deep in EnamlImporter
but didn't understood enough.
Any idea ?
Found the solution. Just had to add a dot for relative import:
with enaml.imports(): from .views import IndexView
Hello, I'll have to create a project. I'm hesitating using enaml-web with Django. Enaml-web is so fun !!
I have seen the question has already been asked #8. You have answered
You talked about LxmlApplication. Haven't see any code relating to that in master.
Could you give me some hints and how to do this coupling ?
Regards