如何使用带有phonegap的django框架?

时间:2021-08-22 02:54:07

I have been looking online and there are some articles about people using Django web framework and Phonegap to build mobile applications.

我一直在网上看,有一些关于人们使用Django Web框架和Phonegap构建移动应用程序的文章。

However, it says on phonegap to upload your HTML, JS, and CSS files to the build. Does that mean you cannot use django to build mobile apps with phonegap?

但是,它在phonegap上说要将HTML,JS和CSS文件上传到构建版本。这是否意味着你不能使用django来构建带有phonegap的移动应用程序?

Any clarifications or steps on how to build would be great.

关于如何构建的任何澄清或步骤都会很棒。

1 个解决方案

#1


1  

Think of PhoneGap as preloaded static web pages in a WebKit view. You can add JavaScript (most people use JQuery/JQueryMobile) to make it dynamic and use AJAX calls to load data from a server but rendering templates is not what it does. You can do fragments but it's not the same thing as Django Templates.

将PhoneGap视为WebKit视图中的预加载静态网页。您可以添加JavaScript(大多数人使用JQuery / JQueryMobile)使其动态化并使用AJAX调用从服务器加载数据,但渲染模板不是它的功能。你可以做片段,但它与Django模板不同。

I am working on a project that handles data loading via an API from a server running Django. The App is being written in PhoneGap and uses AJAX calls for getting the extra data. I'd say look at django apps like TastyPie for helping get data. The main goals in using PhoneGap are 1) better load times of HTML since it's local, 2) Reduced traffic by only sending API data and thus better for cellular networks and 3) access to native feaures in the hardware you don't otherwise get access to with JS in a webpage.

我正在开发一个项目,通过运行Django的服务器上的API处理数据加载。该应用程序正在使用PhoneGap编写,并使用AJAX调用来获取额外数据。我会说像TastyPie这样的django应用程序可以帮助获取数据。使用PhoneGap的主要目标是1)更好的HTML加载时间,因为它是本地的,2)通过仅发送API数据减少流量,从而更好地用于蜂窝网络和3)访问硬件中的本机特性,否则无法访问在网页中使用JS。

#1


1  

Think of PhoneGap as preloaded static web pages in a WebKit view. You can add JavaScript (most people use JQuery/JQueryMobile) to make it dynamic and use AJAX calls to load data from a server but rendering templates is not what it does. You can do fragments but it's not the same thing as Django Templates.

将PhoneGap视为WebKit视图中的预加载静态网页。您可以添加JavaScript(大多数人使用JQuery / JQueryMobile)使其动态化并使用AJAX调用从服务器加载数据,但渲染模板不是它的功能。你可以做片段,但它与Django模板不同。

I am working on a project that handles data loading via an API from a server running Django. The App is being written in PhoneGap and uses AJAX calls for getting the extra data. I'd say look at django apps like TastyPie for helping get data. The main goals in using PhoneGap are 1) better load times of HTML since it's local, 2) Reduced traffic by only sending API data and thus better for cellular networks and 3) access to native feaures in the hardware you don't otherwise get access to with JS in a webpage.

我正在开发一个项目,通过运行Django的服务器上的API处理数据加载。该应用程序正在使用PhoneGap编写,并使用AJAX调用来获取额外数据。我会说像TastyPie这样的django应用程序可以帮助获取数据。使用PhoneGap的主要目标是1)更好的HTML加载时间,因为它是本地的,2)通过仅发送API数据减少流量,从而更好地用于蜂窝网络和3)访问硬件中的本机特性,否则无法访问在网页中使用JS。