简体   繁体   English

难以在Android和iPhone上部署Django应用程序..计划切换到PHP而不是Django

[英]Difficulty deploying Django app on Android and iPhone.. planning on switching to PHP instead of Django

Okay so I am 1/4th finished creating a django application (where users must register an account, log in and can interact with other users of the application, basically a social network. And the application has a PostgreSQL database). 好的,所以我1/4完成了创建一个django应用程序(用户必须注册一个帐户,登录并可以与该应用程序的其他用户交互,基本上是一个社交网络。该应用程序有一个PostgreSQL数据库)。 I decided to do research and figure out ways to actually host this django powered social network site on the internet and make it a mobile app which can be downloaded from the android and iphone appstore. 我决定做研究,并找出在互联网上实际托管这个django支持的社交网站的方法,并使其成为一个可以从android和iphone appstore下载的移动应用程序。 I want to first host the site, so I looked for places to host it. 我想首先托管该网站,所以我寻找了托管它的地方。 I found webfaction.com and this links in particular 我找到了webfaction.com,特别是这个链接

http://docs.webfaction.com/software/django/getting-started.html http://docs.webfaction.com/software/django/getting-started.html

which explains how to host the djnago application. 这解释了如何托管djnago应用程序。 Now, I did not read over it completely but I trust that I can host my social network django application using webfaction without going through a whole bunch of trouble. 现在,我没有完全阅读它,但我相信我可以使用webfaction托管我的社交网络django应用程序,而不会经历一大堆麻烦。 (please correct me if there is someone here who did try hosting a django application and had great difficulty). (如果有人在这里尝试托管django应用程序并且遇到很大困难,请纠正我)。

After hosting it as a site, I also want it to be a mobile application which can be used on iPhones and Androids. 在将其作为网站托管之后,我还希望它是一个可以在iPhone和机器人上使用的移动应用程序。 Now, all I want to know is, what is the least complicated way of doing this properly? 现在,我想知道的是,这样做的最简单的方法是什么? (because I'm guessing all ways will be pretty complicated.. I don't want a step by step tutorial on how to do it, a simple url to a documentation on how to do it is good enough). (因为我猜测所有方法都会非常复杂。我不想要一步一步的教程如何做到这一点,一个关于如何做到这一点的文档的简单网址就足够了)。 Will I need to learn PHP, C, Java or anything else or will I be able to do this with just knowing django and python? 我是否需要学习PHP,C,Java或其他任何东西,或者只要知道django和python,我能做到这一点吗? Note that this isn't just an application where users visit and read information, it's a social network. 请注意,这不仅仅是用户访问和阅读信息的应用程序,它还是一个社交网络。

I just need someone to confirm to me that deploying a social network created using django and hosting it on a site is possible and then taking that app and making it an Android and iOS app without have to completely recreate it with a different language is possible. 我只需要有人向我确认部署使用django创建的社交网络并在网站上托管它是可能的,然后使用该应用程序并使其成为Android和iOS应用程序,而无需使用不同的语言完全重新创建它。 If you can provide me a link to get me started on how to take am existing django app and make it an Android app without having to completely retype the app with a different language, that would be great. 如果您可以为我提供一个链接,让我开始了解如何使用现有的django应用程序并使其成为Android应用程序而无需使用其他语言完全重新键入应用程序,那将是非常棒的。

Simply put: you would create your web app (website) using Python+Django (for the back end) and HTML, JavaScript & CSS (for the front end). 简单地说:您将使用Python + Django(用于后端)和HTML,JavaScript和CSS(用于前端)创建您的Web应用程序(网站)。 Once you've done this, you can make a very basic app for iOS and Android which is really just a browser window pointed to your website. 完成此操作后,您可以为iOS和Android制作一个非常基本的应用程序,它实际上只是一个指向您网站的浏览器窗口。

Google 'android webview' for some examples of embedding your site into an android app with Java (note this is a very basic way of doing it). Google的“android webview”用于将您的网站嵌入到使用Java的Android应用程序中的一些示例(请注意,这是一种非常基本的方式)。

I don't think you're understanding the fundamentals here... 我认为你不了解这里的基本面......

A NATIVE app for iOS must be written in Objective C or Swift. iOS的NATIVE应用程序必须使用Objective C或Swift编写。

A NATIVE app for Android must be written in Java. Android的NATIVE应用程序必须用Java编写。

You simply cannot compile and deploy a web application written in Django to Objective C or Java (to the best of my knowledge). 您根本无法将使用Django编写的Web应用程序编译和部署到Objective C或Java(据我所知)。

However, it's possible to write an HTML5/JavaScript web application that can be compiled to one of the respective native platforms, using Appcellerator or PhoneGap . 但是,可以使用AppcelleratorPhoneGap编写可以编译到相应本机平台之一的HTML5 / JavaScript Web应用程序。 The backend data provider for such an app could certainly be a REST API powered by Django. 这种应用程序的后端数据提供程序当然可以是由Django支持的REST API。

I don't know Objective C or Java, so I stick with the tool set I know - Django, Python, HTML5, Twitter Bootstrap and JavaScript to create mobile friendly web apps. 我不知道Objective C或Java,所以我坚持使用我所知道的工具集 - Django,Python,HTML5,Twitter Bootstrap和JavaScript来创建移动友好的 Web应用程序。 These are web sites using responsive CSS to format the content best for mobile and tablet viewports, but they are NOT native iOS or Android applications. 这些是使用响应式CSS格式化最适合移动和平板电脑视口的内容的网站,但它们不是原生 iOS或Android应用程序。

Actually you can have a python app compile to native C on both iOS and Android and get them accepted into the relevant app stores. 实际上,您可以在iOS和Android上将python应用程序编译为本机C,并将其接受到相关的应用商店中。 Check http://kivy.org and http://Cython.org 查看http://kivy.orghttp://Cython.org

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM