![]() This is just scratching django’s surface but enough for our purposes. models.py define the structure of the tables the app needs, views.py the http request handlers and templates the html templates. There is nothing Cloud Foundry or SAP specific there. It also defines the urls this app exposes. The tasks folder defines the views, models and html templates our app will use. Procfile contains python and django-specific commands that are executed when the app is deployed.In our case an app called “djangotasks” with a dependency on a service called “postgres-service”. manifest.yml lists the apps and their services.runtime.txt – lists the python version that will be used.Manifest.yml, Procfile and runtime.txt are crucial to make it run on Cloud Foundry: (I know the names could be better, bear with me). We have an app folder called “tasks” and a project called “tasks_django”. To start quickly you can clone my repository ( ) I’ll just point out the important bits to make it run on this platform. Of course, there is nothing there stopping you from using client-side rendering frameworks, such as SAPUI5, but nevertheless, the framework is good and has a huge community. I say classical because it follows a kind of Model-Template-View paradigm where html is rendered server side. Let’s first build a mini web app based on Django.ĭjango is a great python based classical web framework. These are automagically created by the platform and will be provided to the application in runtime after you declare that it uses that service. We didn’t specify a user/password or port number for the database. To use it, just start the service:Ĭf create-service postgresql v9.4-container postgres-service We’ll use the postgresql because it is well supported by Django. The platform gives us some options out of the box with the cf marketplace command: Our app is going to need a database to store the data. You’ll see the project space and organization you’ve set up earlier in the YaaS builder. For me these are the same as in the HANA Cloud Platform trial. You’ll be required to enter the credentials. These are needed in a proper setup to support billing.Īfter that you’ll be able to login into the platform with the cf tool: Hint: In the builder section, create an organization and a space. I did this on a linux box so installed with the following command:įollow Rui Nogueira’s post on how to setup a trial account on YaaS. Select Continue again, and then select Install Software. In the Installation Wizard, select Continue, and then select the destination folder for the cf CLI software. ![]() Unpack the zip file, and run the cf executable file. In the case of Cloud Foundry, you manage the platform with a command line tool called cf. In Cloud Foundry you have “aplications” which run with the support of buildpacks and “services” which your code can use. This requires a slightly different mindset than the one used for managing a full server. It stores “Tasks” in a table and lists them:ĭata is stored in a PostgreSQL database provided out-of-the box on this Cloud Foundry service.Ĭloud Foundry, which is now fully supported on SAP HCP, is a platform as a service. I’m very excited with these news and decided to give it a go by using the awesome Django framework to build a trivial web app as a proof of concept and deploy it there. The fact that it is based on an open standard backed by many big companies besides SAP increases innovation speed and hopefully creates a very strong foundation to implement for. ![]() Java and Javascript are of course also supported. It allows, for instance, to use programming languages like Ruby, Go, Python or even Clojure (and their libraries) to develop services and still be hosted on the SAP cloud. This brings a whole new range of options when developing for SAP. ![]() This post documents my experience deploying a basic Python based web app to it.īack in May SAP Hana Cloud platform reached a new milestone with the beta availability of the starter edition for Cloud Foundry services. Cloud Foundry services on the SAP Hana Cloud Platform (HCP) have recently changed to beta status. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |