git clone https://github.com/phillipbroberts/pbr.git
cd pbr
virtualenv --no-site-packages ./env
source ./env/bin/activate
pip install -r requirements.txt
After this edit the config.py
file
Replace the CONNECTION_STRING
variable with your own connection string;
Replace the DATABASE
variable to your own one;
If the default collection names don't work for you please replace the POSTS_COLLECTION
, USERS_COLLECTION
and USERS_COLLECTION
variables to any names you like;
If you use this code on a production sever replace the DEBUG
variable with False
.
When you in project dir with actived environment just type in terminal
python web.py
or
gunicorn web:app
When you run the application for the first time the "Install" page appears. You need to create a user profile and set some display settings on this page.
If you have an account on Gravatar and your logged-in email links to it, the userpic will display. It will be a random gravatar image if it doesn't.
All necessary MongoDB indexes will be created during the installation. A test text post will be created as well.
There should be at least one post and one user for the database to be installed. That is why it's impossible to delete the last post or user.
If you want to start it from scratch please remove all existing collections from your database and delete the browser session cookie. The Install page will show up again.
For deploying you can use Heroku and mongolab for example.
If you are using mongolab, please copy the outlined on the screenshot line to connect using driver, type in your dbuser and dbpassword and paste the line into the CONNECTION_STRING
variable in the config.py
file.
For Heroku you'll find gunicorn
server in the requirements.txt
file. You are welcome to see how to deploy a Python web application on Heroku here.
WYSIWYG editor uses Markdown. Only available on the editor panel tags are intepreted.
The editor is based on MDMagick project.
To insert any tag you need to SELECT a word and then click on a needed tag on the editor panel.
You can insert github Gists.
For this type a word in the editor, select it like you did when you added a tag from the panel, copy the embed gist link from the github gists page and paste it to the dialog window.
The word will be replaced with a working gist tag.
To insert an image you also need to select a word that will be used like a title attribute and paste the image URL into the dialog window.
Don't need to highlight text to add a link or an image anymore. Now you can simply click some tag in the editor menu and put a link. The 'Markdown' tag will be created automatically with a highlighted temporary description. The existing pasting algorithm works as it did before.
Originally based off of flask-blog at git clone https://github.com/dmaslov/flask-blog.git