/flask-appointment-calendar

the simple little appointment scheduler hosted at http://wpicmeet.com

Primary LanguagePythonOtherNOASSERTION

Introduction

This project provide a simple but powerful web calendar system for making apppointment, anonymously, and exclusively. It is suitable to use as a personal schedule, where your customers from all over the world make appointment to you, and you can arrange your schedule based on the appointments.

Features:

  1. No need to register and activation your account. Just make an appointment as you need.
  2. It supports HTTP session.
  3. Has a customized, powerful js time range selection widget based on jquery-ui slider,
    • Exclusive appointments
    • Support timezone
    • Dynamic updates via Ajax when date or timezone changed.

Techniques:

  1. fbone, the project template
  2. bootstrap-calendar, for index page calendar, with some customized event listeners and UI.
  3. bootstrap-datetimepicker, for verbose datetime picker.
  4. jquery ui slider: A real selling point of this project.

Setup

This project starts from fbone for faster prototyping with Python Flask.

You need the following installed:

  • Python 2.7
  • virtualenv
  • pip
  • fabric

Instructions to setup the test development:

Clone:

git clone git@github.com:wpic/flask-appointment-calendar.git

Setup virtualenv:

fab setup

Debug and test(this will erase the old database data):

source env/bin/activate
fab d

Restart:

source env/bin/activate
python manage.py run

Deployment

Here’s a sample deployment steps with Ubuntu/Apache(mod_wsgi).

sudo apt-get install git apache2 mysql-server libmysqlclient-dev

Install mod_wsgi for python flask web framework:

# Install mod-wsgi
sudo apt-get install libapache2-mod-wsgi

Install pip and fabric, install necessary requirement packages to virtualenv:

fab setup

Add a sample conf file for Apache virtual host:

<VirtualHost *:80>
        ServerAdmin webmaster@localhost

        ServerName webmeet.com
        ServerAlias web-calendar.web-demo.com

        WSGIDaemonProcess fbone user=www-data group=www-data threads=2
        WSGIScriptAlias / /var/www/web-calendar/public_html/app.wsgi

        DocumentRoot /var/www/web-calendar/public_html/
        <Directory /var/www/web-calendar/public_html/>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride All
                Order allow,deny
                allow from all
        </Directory>

        Alias /robots.txt /var/www/shared/robots.txt

        <Location /server-status>
                SetHandler server-status
        </Location>

        ErrorLog /var/www/web-calendar/logs/error.log

        # Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg.
        LogLevel warn

        CustomLog /var/www/web-calendar/logs/access.log combined
</VirtualHost>

Modify production_config.py file:

  • DEBUG
  • SECRET_KEY
  • SQLALCHEMY_DATABASE_URI
  • MAIL_USERNAME
  • MAIL_PASSWORD

Then install this project to virtual env:

source env/bin/activate
python setup.py install

Upgrade

git pull origin master
source env/bin/activate
python setup.py install
sudo /etc/init.d/apache2 restart

Admin

The hidden entrance:

  • Login: http://localhost:5000/login (username: admin, password: 123456)
  • Register: http://localhost:5000/signup
  • Make an appointment: http://localhost:5000/appointment/create