Skip to content

Latest commit

 

History

History
74 lines (55 loc) · 2.14 KB

README.md

File metadata and controls

74 lines (55 loc) · 2.14 KB

myCMS

myCMS is an example RESTful API for content management (ie blog articles, surveys, photo galleries) built on Python Flask and MongoDB. It can be used to get started and play, and may even be the basis for your own project development.

Current functionality

  • Add an article
  • Retrieve all articles sorted by date
  • Retrieve all articles by tag
  • Retrieve a article
  • Register users
  • Record article view/comment interactions by time
  • Retrieve all comments or a page of comments for an article
  • Basic HTTP authentication with username/ hashed password lookup

Planned functionality

  • Front-end for content
  • API for admin functionality

Getting started

Clone this Github repo:

$ git clone http://www.github.com/prasoonk/mycms_mongodb
$ cd mycms-mongodb

Optionally, create a Python virtualenv and activate it.

$ virtualenv venv
$ source venv/bin/activate

Install dependencies using pip and the provided requirements.txt file:

$ pip install –r requirements.txt

Start a MongoDB server, using init/service commands, or manually at the shell:

$ mkdir –p data/db
$ mongod --dbpath=data/db --fork --logpath=mongod.log

And now you can start the myCMS API server. By default, it runs on port 5000 on the localhost.

$ python web.py

Optionally, if you're using virtualenv, remember to deactivate it when you shutdown the server and do not require it any further.

$ deactivate

Further reading

Please read the online documentation for more about data modeling in MongoDB, including sections on common use cases (which myCMS is based in part).

Disclaimer

Important note: myCMS is example source code and should not be used for production purposes. MongoDB does not support or maintain myCMS.