Skip to content

Instantly share code, notes, and snippets.

@zhouzhuojie
Created March 18, 2014 01:47
Show Gist options
  • Save zhouzhuojie/9612073 to your computer and use it in GitHub Desktop.
Save zhouzhuojie/9612073 to your computer and use it in GitHub Desktop.
Engedit Manual
Engedit Manual
===========
Written with Python Flask Framework, if you want to port to PHP or Node.js, just change the templates in `app/templates` folder.
How to run the website
------------------------
* **SSH** Running from Mac or Linux console, use [putty](http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html) if you are on Windows:
```
ssh -i ~/PATH/TO/engeditorg.pem ubuntu@ec2-54-242-188-118.compute-1.amazonaws.com
```
Note that the `engeditorg.pem` is located at `Engedit\帐号信息\Amazon_aws_secret_key`
* **Installation** (if you haven't install python flask and its extensions)
After you have logged in SSH,
```
pip install -r requirements.txt # install dependencies
python manage.py db_create # create database
python manage.py db_content # push some scheme into the database
```
* **Run**
* Debug mode
```
sudo python manage.py run_debug &
```
* Production mode (using tornado to add more power to it)
```
sudo python manage.py runserver_production_tornado &
```
Try to run the code with `&` appended to the commend, to make it as a background process.
How to update the website
-------------------------
Two options:
1. Use [WinSCP](http://winscp.net/download/winscp551setup.exe) to copy edited templates to the remote SSH server. Remember to use the `engeditorg.pem` as the ssh option.
2. Directly login with SSH and edit the file directly from SSH, using console text editor like Vim or Pico
How to locate the content of the page:
1. Try to search by `grep` or other full text search tool to find content in the folder `app/templates`
2. Change the content if you like. Upload can be done with WinSCP.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment