Giter Club home page Giter Club logo

eventum's Introduction

Eventum

Eventum is a content management system for an event-driven blog that syncs with Google Calendar.

Eventum

Getting Started

  1. First things first, make sure to install Eventum. To do so, use pip:

    pip install -U eventum
  2. Install MongoDB (Ubuntu Linux, OSX).

    On OSX, you may have to run mkdir /data /data/db before you can run mongod without errors.

  3. Install SASS gem

    gem install sass

    Otherwise, you will see an intermittent OSError

  4. Authorize your application with Google.

    $ python -m eventum.authorize <CLIENT-SECRET-PATH> <CLIENT-CREDENTIALS-PATH>
  5. Eventum needs to have several configuration variables set in the Flask config object in order to operate properly. These may be set as key/value pairs in a dictionary called EVENTUM_SETTINGS, or may be set individually with the prefix EVENTUM_.

    • INSTALLED_APP_CLIENT_SECRET_PATH: Path from the root of your project to the installed application client secret JSON file downloaded from Google.
    • INSTALLED_APP_CREDENTIALS_PATH: Path from the root of your project to the installed application credentials JSON file generated by the authorization in the previous step.
    • CLIENT_SECRETS_PATH: Path from the root of your project to the client secret JSON file
    • PRIVATE_CALENDAR_ID: The Google Calendar ID for the private calendar to which unpublished events should be synced.
    • PUBLIC_CALENDAR_ID: The Google Calendar ID for the public calendar to which published events should be synced.
    • UPLOAD_FOLDER: Path from the root of your project to the folder where uploaded images should be stored.
    • DELETE_FOLDER: Path from the root of your project to the folder where uploaded images that are then deleted should be stored.

    Here's an example of what that might look like:

    from flask import Flask
    app = Flask(__name__)
    app.config['EVENTUM_SETTINGS'] = {
        'INSTALLED_APP_CLIENT_SECRET_PATH': 'config/inst_client_secrets.json'
        'INSTALLED_APP_CREDENTIALS_PATH': 'config/inst_credentials.json'
        'CLIENT_SECRETS_PATH': 'config/oauth_client_secrets.json'
        'PRIVATE_CALENDAR_ID': '[email protected]'
        'PUBLIC_CALENDAR_ID': '[email protected]'
        'UPLOAD_FOLDER': 'app/static/img/uploaded'
        'DELETE_FOLDER': 'app/static/img/uploaded/deleted'
    }
  6. Initialized the Eventum class, passing in your Flask app:

    from eventum import Eventum
    eventum = Eventum(app)

Configuration Options

Eventum can be configured using Flask configuration settings. Configurations can be supplied in a group, by defining key/value pairs in a dictionary called EVENTUM_SETTINGS, or they can be provided individually with the prefix EVENTUM_. Here are all of the Eventum configuration options, with their defaults. Note that CSRF_ENABLED is a Flask configuration and MONGODB_SETTINGS is a Mongoengine configuration:

# We enable Flask CSRF for secure forms.
CSRF_ENABLED = True

# We default to using the MongoDB 'eventum' database in Mongoengine
MONGODB_SETTINGS = {'DB': 'eventum'}

# Path the default profile picture to use in Eventum
EVENTUM_DEFAULT_PROFILE_PICTURE = 'img/default_profile_picture.png'

# Path to the default event image
EVENTUM_DEFAULT_EVENT_IMAGE = 'img/default_event_image.jpg'

# Whether or not Google Auth should be enabled or not.  If it is not enabled,
# you will default to a super-user account that bypasses all Google auth.
EVENTUM_GOOGLE_AUTH_ENABLED = True

# The name of the application log 
EVENTUM_APP_LOG_NAME = 'app.log'

# The name of the Werkzeug log 
EVENTUM_WERKZEUG_LOG_NAME = 'werkzeug.log'

# The maximum size of the Eventum logs 
EVENTUM_LOG_FILE_MAX_SIZE = 256

# The URL at which the Eventum admin interface should be mounted.
EVENTUM_URL_PREFIX = '/admin'

# File extensions that are allowed to be uploaded via the Media tab.
EVENTUM_ALLOWED_UPLOAD_EXTENSIONS = set(['.png', '.jpg', '.jpeg', '.gif'])

# The Eventum base path. If you're not sure what this is, don't mess with it.
EVENTUM_BASEDIR = eventum.__path__[0]

# Eventum static folder
EVENTUM_STATIC_FOLDER = path.join(EVENTUM_BASEDIR, 'static/')

# Eventum  SCSS folder
EVENTUM_SCSS_FOLDER = path.join(EVENTUM_STATIC_FOLDER, 'eventum_scss/')

# Eventum templates folder
EVENTUM_TEMPLATE_FOLDER = path.join(EVENTUM_BASEDIR, 'templates/')

######################
# Must be overridden #
######################

# Path from the root of your project to the installed application client
# secret JSON file downloaded from Google.
EVENTUM_INSTALLED_APP_CLIENT_SECRET_PATH = None

# Path from the root of your project to the installed application credentials 
# JSON file generated by the authorization in the previous step.
EVENTUM_INSTALLED_APP_CREDENTIALS_PATH = None

# Path from the root of your project to the client secret JSON file 
EVENTUM_CLIENT_SECRETS_PATH = None

# The [Google Calendar ID][gcal-id] for the private calendar to which
# unpublished events should be synced.
EVENTUM_PRIVATE_CALENDAR_ID = None

# The [Google Calendar ID][gcal-id] for the public calendar to which published
# events should be synced.
EVENTUM_PUBLIC_CALENDAR_ID = None

# Path from the root of your project to the folder where uploaded images
# should be stored. 
EVENTUM_UPLOAD_FOLDER = None

# Path from the root of your project to the folder where uploaded images that
# are then deleted should be stored.
EVENTUM_DELETE_FOLDER = None

# Will be set elsewhere, do not set directly
EVENTUM_GOOGLE_CLIENT_ID = None

Developing

Here's how to run Eventum in a development environment:

mongod &
python setup.py devlelop

Developing without Authentication

It is possible to run Eventum without logging in using Google+ or authenticating with Google Calendar. To do so, set the Flask configuration variable EVENTUM_GOOGLE_AUTH_ENABLED to FALSE:

# Whether or not to enable Google Auth or not.
echo $EVENTUM_GOOGLE_AUTH_ENABLED

Publishing to PyPI

Follow the Peter Down's tutorial to get setup, and then you can do several things:

Publish to PyPI Testing:

python setup.py sdist upload -r pypitest

Publish to PyPI Live:

python setup.py sdist upload -r pypi

About Eventum

Stack

Organization / Structure

.
├── docs             # Builds our Sphinx documentation
├── eventum          # The Eventum module
│   ├── forms        # Flask-WTForms models, used for generating forms in HTML
│   │                #     and validating input
│   ├── lib          # Misc helpers, tasks, and modular libraries
│   ├── models       # Mongoengine Models
│   ├── routes       # All Flask routes, using Blueprints
│   ├── static
│   │   ├── css      # CSS
│   │   │   └── lib  # CSS libraries
│   │   ├── img      # Images
│   │   ├── js       # Javascript files
│   │   └── eventum_scss    # Stylesheets
│   ├── templates    # HTML templates
│   └── __init__.py  # All app-wide setup.  Called by `run.py`
└── Manifest.in      # Files to be included in the app.

Screenshots

home editors events

eventum's People

Contributors

alanhdu avatar howon avatar schlosser avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

eventum's Issues

startup fair page

doesn't need companies yet necessarily but we should have a 2014 landing page

background email tasks

we should have an easy way to fire off an email with certain actions:
i.e.: when an event is made send a notification to workshops/partnerships

Remove author text from posts

@gleanawa

The process for doing this:

  • Go in the admin interface to each post
  • If the post was written by a user that is currently on eventum, then change the author field, and remove any byline at the end of the post.
  • If the post was written by a guest writer or anyone else that is not a user, then make a fake user for them in the users section and set them as the author, again removing bylines.

Google Calendar Quirks

Making changes to the recurrence or start / end date of an entire event series that has had one of it's instances deleted / cancelled results in an event being made in Eventum that won't show up in Google Calendar. Either:

  • Don't create it in Evenum (figure out how to do these migrations better)
  • Create an entirely new Google Calendar event series to match the new Eventum objects

We should run jobs in RQ

Like Google Calendar requests, clean up images in app/static/img/uploaded/_deleted, email owners of events, etc.

Unittests

For all routes, models, and utils.

Docstrings

Every method should have a docstring with a description and arguments

Let users change their profile pictures

On the User model in app/models/User.py, there are two fields, a image field that is a reference to an Image object (uploaded and then selected with the image picker) and an image_url field, which is where we store their google plus profile picture.

I think that the implementation we should use for this would involve people changing their picture from the google plus url to a picture of their choosing from upload.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.