Using either screen or nohup command is not ideal for running a script continuously as the system will not start the script again if it fails although many Stack Overflow answers recommend using one of those. Instead, you need to daemonize your script. AMI Amazon Linux AMI 2017.09.1.20171120 x86_64 HVM Installation sudo pip install supervisor… Continue reading Run Scripts Continuously on AWS EC2 Instance Using Supervisord
Python – Creating a Virtual Environment for Python2 or Python3
1. Install virtualenv. 2. cd into your project directory. 3. Create virtual environment. This will create venv directory under your project. 4. Activate virtualenv Done. Install whatever package you need for your project using More… If you are creating a virtual environment for python3, and you have python3 at the system level, simply replace step… Continue reading Python – Creating a Virtual Environment for Python2 or Python3
Saving SSH session in Terminal
For Windows users, use PuTTY. For Mac users, locate to .ssh folder which is under the root folder and create a file named “config” – you can simply use TextEdit. Note: since .ssh folder is hidden, you can type the below command to view hidden files. In your “config’ file, write and save the server… Continue reading Saving SSH session in Terminal
Google App Engine – How to build a user profile page with webapp2
The idea of building a unique page for each user is very similar to building a page for each post. You can simply use the ID of a user entity. Since I already have an entity for user, I do not need to create another one. Therefore, I only need to create a class. Before… Continue reading Google App Engine – How to build a user profile page with webapp2
Google App Engine – Finding the location of a user using X- AppEngine
I am currently working on another project and it requires me to find the location of users who are accessing my site. After some research, I found that there is a Google’s public API that tracks the location of a user: X- AppEngine X-AppEngine finds the location of a user using the IP address from… Continue reading Google App Engine – Finding the location of a user using X- AppEngine
Google App Engine Migrating from db to ndb datastore – creating a commenting system with webapp2 (part 2)
This post will cover fetching comments associated with a particular post and rendering the comments using Jinja2 template. The concept is pretty much the same as using the db model. Check out the below code. I first built a key of the post and fetched the post to pass it into params. Then I fetched… Continue reading Google App Engine Migrating from db to ndb datastore – creating a commenting system with webapp2 (part 2)
Google App Engine Migrating from db to ndb datastore – creating a commenting system with webapp2 (part 1)
My previous post covered creating a commenting system using webapp2 with Jinja2 template. You can store comments into db model and render filtered comments using the key of a question. Click this link to see the post. https://buzzcoding.com/2016/10/04/how-to-create-a-blog-comment-system-with-webapp2-on-google-app-engine-part-1/ This post is about creating the exact same commenting system except I will be using ndb model.… Continue reading Google App Engine Migrating from db to ndb datastore – creating a commenting system with webapp2 (part 1)
How to create a blog comment system with webapp2 (on Google App Engine) – Part 2
From the previous post, I went over storing comments into db model and this post will cover how to rendered the store comments associated with questions that have those comments. It was actually simpler than I thought it would be. See the below code. What I did here is that I fetched the question entity… Continue reading How to create a blog comment system with webapp2 (on Google App Engine) – Part 2
How to create a blog comment system with webapp2 (on Google App Engine) – Part 1
I am developing a Q&A website. Therefore, people must be able to answer questions and this system would be the same as commenting on posts. This is going to be a little longer than other posts so I divided this post by 2 sections: 1. Creating database and storing comments. 2. Rendering comments using Jinja2… Continue reading How to create a blog comment system with webapp2 (on Google App Engine) – Part 1
Google App Engine (with Jinja2 and webapp2) – allow hyperlinks in your textarea using CKEditor
My webapp allows users to submit questions and answer questions. I wanted to allow users to be able to submit hypelinks as well as format their contents to make it more visual and informative. I discovered that I needed to use what’s called the “rich-text editor” which allows users to edit their contents within web… Continue reading Google App Engine (with Jinja2 and webapp2) – allow hyperlinks in your textarea using CKEditor