Skip to content

boldprogressives/actionkit-csv-events

Repository files navigation

The code comes with a simple Django project and Heroku configuration that can be used to get a free hosted version quickly up and running. The configuration will be suitable for demo purposes and for light internal usage. I have set it up to be as easy as possible to install, and to be fully functional on Heroku's free tier -- in several places trading performance for ease of setup.

If you plan to use this heavily (e.g. a large number of simultaneous staff users, or more than a few dozen events at a time) I recommend examining the configuration and making changes to suit your needs.

The Django project will provide:

  • Synchronous processing of events
  • A Bootstrap-based base template, a login view, and a homepage
  • All functionality locked down to logged-in users only
  • All logged in users have full access to upload events
  • Django Flat Pages are installed so you can add your own help pages, etc
  • All site templates can be modified through the web using django-dbtemplates
  • Through-the-web access to Django's Admin Site to manage users, templates, and flat pages

The core functionality is provided in an isolated Django app called "event_uploader". This can be integrated into any larger Django project, if the provided Django project does not meet your needs.

Quick-Start on Heroku

You will need to create an account on Heroku and install the Heroku Toolbelt. Then, from a terminal:

git clone git://github.com/boldprogressives/actionkit-csv-events.git
cd actionkit-csv-events
heroku apps:create
git push heroku master
python standalone_django_project/required_environ.py env_vars
heroku config:set `cat env_vars`
heroku run python manage.py syncdb
heroku open

You will be prompted for input a few times during the installation -- for example to provide API and database credentials to your Actionkit instance, and to create a new Django superuser to log in to the site. When this is done, a web browser will open and prompt you to log in.

You should log in using the username and password for the Django superuser that you just created.

After logging in, visit /admin/actionkit/test_connection/ in the browser to confirm that your Actionkit database and API connection are properly configured.

== Debugging ==

If something goes wrong, you can run the following command in a terminal to view the application's logs as you interact with the site:

heroku logs -t

That might provide enough information to figure out the problem. If not, you can switch the site into debug mode by running:

heroku config:set DJANGO_DEBUG=1 DJANGO_DEBUG_TOOLBAR=1 INTERNAL_IPS=*

This will cause the site to display detailed debugging information in the browser when any error occurs. It will also cause the site to have a "debug mode" sidebar that can be expanded on any page to view detailed SQL logs and other information.

When you're finished debugging, you should take the site out of debug mode by running:

{{{ heroku config:unset DJANGO_DEBUG DJANGO_DEBUG_TOOLBAR INTERNAL_IPS }}}

Quick-Start for Local Development

To develop and run the system locally looks similar to running on Heroku:

git clone git://github.com/boldprogressives/actionkit-csv-events.git
cd actionkit-csv-events
virtualenv venv
./venv/bin/pip install -r requirements.txt
./venv/bin/python standalone_django_project/required_environ.py env_vars
export `cat env_vars`
export DATABASE_URL=sqlite:///`pwd`/dev.sqlite
./venv/bin/python manage.py syncdb
./venv/bin/python manage.py runserver

Deficiencies

As mentioned above, this setup lacks several important components of a secure, maintainable production infrastructure. For example:

  • Static files are served locally from the Heroku environment instead of e.g. S3
  • No system is set up to capture access and error logs (e.g. Papertrail)
  • The site is served over HTTP instead of HTTPS
  • Events are uploaded synchronously, instead of asynchronously (e.g. using Celery)

If you plan on leaving this web application running for a long time and using it heavily, setting up your own installation instead of relying on this quick-start guide is highly recommended.

About

Bulk-upload spreadsheets to create Actionkit events

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published