Create a site on EP. Io

Source: Internet
Author: User
Tags cloud hosting

Ep. Io is a python-based cloud hosting service provider. Founder Andrew (main contributor to Django, the most fluent Python web framework), is currently supported at the technical level. Currently, this is an invitation. You need to send an email to him. He will activate it later.

Now let's take a look at how to write a hello World site on EP. Io. Because I don't like Django's heavy framework very much, I chose flask.

One step is to ensure that the following components are installed on your machine.

 
Sudo apt-Get git
Sudo apt-Get Python-pip
Sudo apt-Get openssh-Client

Install the epio management component

 
PIP install epio

The next step is the key SSH key that is important in the deploy process. If no SSH key is generated

 
Ssh-keygen

Run the following command to upload

 
Epio upload_ssh_key

If everything above is normal, you can start to write some flaskCode.

If flask is not installed locally, run the following command to install

 
PIP install flask

Create a folder

 
Mkdir EP

Create an app. py file with the following code:

FromFlaskImportFlask
APP = flask (_ Name __)

@ App. Route ('/')
DefIndex ():
Return 'Hello from flask! \ N'

If _ Name __='_ Main __':
App. Run (DEBUG = true)

Test locally to see if there are any problems.

 
Python app. py

If no problem exists, prepare the publishing file.

The first is epio. ini.

[Wsgi]
Entrypoint = app: app
Requirements = requirements.txt

This requirements file (requirements.txt) has only one line:

 
Flask

Now we can release our application.

 
Epio create [Optional appname]
Epio upload

Okay. You can access your application through http://appname.ep.io!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.