Repository reorganization and port to gunicorn
This merge request significantly reorganizes the repository and sets it up to work with Gunicorn as a backend webserver behind an Apache reverse proxy. The new organization follows the recommendations from Two Scoops.
A summary of the changes is as follows:
- Created a new
config
directory which containssettings/
, the wsgi script (renamed towsgi.py
fromdjango.wsgi
), and the mainurls.py
. - Renamed the
gracedb
app toevents
- Created a
gracedb
directory for housing all apps, templates, and static content - Created a
core
app for collecting random utilities - Moved both user and admin documentation to a
docs/
directory - Moved the API code to a subfolder of the
events
app - Deleted all fixtures and rewrote unit tests to work without them
- Updated the authentication middleware to use the correct request headers which are used in place of Apache environment variables when Apache is configured as a reverse proxy.
- Deleted the copy of the VOEventLib library which was stored in this repository; now using the system package.
- Added a config script for running Gunicorn. Note that the actual Gunicorn process is started by systemd, which is part of the Puppet configuration update mentioned below.
There is a corresponding update to the Puppet configuration for the server which needs to be applied in concert, as well as one to the gracedb scripts repository.
This update is functional and has passed all server and client unit tests for a new database constructed from migrations. One thing which needs to be done is to define a procedure for implementing it in an already-existing database. The main concern is renaming the gracedb
app to events
. This will require changes to the database tables. This is currently being tested and a full procedure will be posted before.
More details about the move to Gunicorn are on the redmine page.