EuroPython / djep

EuroPython 2014 conference software
https://ep2014.europython.eu/
BSD 3-Clause "New" or "Revised" License
37 stars 18 forks source link

.. image:: https://travis-ci.org/EuroPython/djep.png?branch=develop :target: https://travis-ci.org/EuroPython/djep

Installation

First you have to clone this repository and all its submodules::

git clone git@github.com:EuroPython/djep.git
cd djep

Next create a virtualenv and install all the requirments into it. In this example we are using virtualenvwrapper to manage the virtualenv::

mkvirtualenv djep

This repository provides requirements and configurations for various environments. Each environment (dev, staging and production) has its own requirements.txt.

For local development, install the requirements specified in requirements/dev.txt::

pip install -r requirements/dev.txt

Now that this is complete, you can optionally change some settings. To get an overview of what settings are available, take a look at the pyconde.settings module.

We are using django-configurations_ to manage all settings and try to expose all relevant settings as environment variables. By default you will probably want to set following variables::

export DJANGO_CONFIGURATION=Dev

If you want to use a different database system than PostgreSQL and a different database than "djep", set the DJANGO_DATABASE_URL environment variable. You can find some examples in the dj-database-url <https://github.com/kennethreitz/dj-database-url/blob/master/test_dj_database_url.py>_ test module.

Another environment variable you absolutely have to set is DJANGO_SECRET_KEY::

export DJANGO_SECRET_KEY=...

.. note::

Note that this value should be constant for your local installation.

Everything should be in place now to initialize the database.

.. warning::

Make sure you have redis up and running. Otherwise Django won't start due
to a missing connection to the cache. See `Development` section below for
details.

If you want to use SQLite be warned that there are some issues with the migration steps done for some of django-cms' plugins. Therefore you will most likely have to run this::

python manage.py syncdb --noinput --migrate

If you want to use PostgreSQL (which is also used in production for this site), alter the DATABASES section of your pyconde/settings.py accordingly and then run following command::

python manage.py syncdb --noinput --migrate

After this is done, you should already have a working site, but it is still empty. To change that you can load a fixture with initial data by running::

python manage.py loaddata fixtures/europython2014/initial01.json
python manage.py loaddata fixtures/europython2014/initial02.json

You can login as user admin with password admin

Or you create an admin user in order to gain access to the admin panel::

python manage.py createsuperuser

This will prompt a couple of questions you have to fill out.

.. warning::

Be aware that no user profile is created for this superuser as this is
normally done during the registration process. Thus every access from a
user instance to its profile will fail.

After this is complete, start the development-server on port 8000 with::

python manage.py runserver

Style integration

Right now this project doesn't come with compiled css files but relies on Grunt and Compass to generate them. To install them, run the following commands. They will also install all the requirements those tools rely on::

gem install --user-install compass
npm install
cd pyconde/skins/ep14/static/assets && ../../../../../node_modules/bower/bin/bower install

Development

During development you will need a dummy mail server and other services that are usually run system-wide in production. To help you keep all these services under control the project provides a sample Procfile which you can use with foreman or honcho::

$ foreman start

or::

$ honcho start

However, the minimum is a running Redis server to get the project running. It is sufficient to simply launch the server before using the manage.py CLI::

$ redis-server

Using Vagrant

If you have Vagrant and VirtualBox installed, you can also use the provided Vagrantfile to start a virtual machine with all the non-Python requirements already installed::

$ vagrant up

Once the virtual machine is running and you've ssh'd into it, you are already in a virtualenv into which you can install the Python-requirements::

$ cd /vagrant
$ npm install
$ pip install -r requirements/dev.txt

With this step also comes honcho_ which you can then start with honcho start which starts the dev server on port 8000 which is exposed to port 8080 on your local host machine.

Note that you will need a filled database before this provides you a working system. PostgreSQL is already available and running inside the virtual machine.

Deployment

live: fab -c live.ini upgrade staging: fab -c staging.ini upgrade

Symposion

Parts of this project are based on work by the Symposion/Pinax team. Apps originating in Symposion are:

Other 3rd-party components

This repository also contains various icons created by Paul Robert Lloyd_. Every site using this component must either indicate this in the footer or in the imprint.

.. _Paul Robert Lloyd: http://www.paulrobertlloyd.com/2009/06/social_media_icons/ .. _foreman: https://github.com/ddollar/foreman .. _django-configurations: http://django-configurations.readthedocs.org/en/latest/ .. _honcho: https://github.com/nickstenning/honcho .. _vagrant: http://www.vagrantup.com/ .. _virtualbox: https://www.virtualbox.org/