2017-03-31 00:37:39 +00:00
|
|
|
symposion_app
|
2017-08-01 05:23:50 +00:00
|
|
|
=============
|
|
|
|
|
|
|
|
.. contents::
|
2016-04-25 09:40:35 +00:00
|
|
|
|
2017-03-31 00:37:39 +00:00
|
|
|
At this time, considerations have not been made to have the django project run
|
|
|
|
without additional infrastructure.
|
2016-04-25 09:40:35 +00:00
|
|
|
|
2017-08-08 06:19:33 +00:00
|
|
|
This can be configured in the future by switching the default
|
2017-03-31 00:37:39 +00:00
|
|
|
DEFAULT_FILE_STORAGE django default, and properly configuring django to load
|
|
|
|
subsequent configuration to switch this back to GCS on run in our testing
|
|
|
|
and production environments.
|
2016-04-25 09:40:35 +00:00
|
|
|
|
2017-03-31 00:37:39 +00:00
|
|
|
Login is a bit more complicated, the default flow redirects you out to a SAML
|
|
|
|
server, you can probably work something out with testshib. But if you go to
|
|
|
|
/admin and log in, that will persist into /dashboard.
|
|
|
|
|
|
|
|
|
|
|
|
Required Configuration
|
|
|
|
----------------------
|
|
|
|
|
|
|
|
GCS
|
|
|
|
~~~
|
|
|
|
|
|
|
|
1. Set the bucket in settings.py
|
|
|
|
1. Store your Service Account JSON in a file
|
|
|
|
1. Set GOOGLE_APPLICATION_CREDENTIALS to your account file
|
2017-03-31 01:09:41 +00:00
|
|
|
1. Set GCS_BUCKET to your bucket name
|
2017-03-31 00:37:39 +00:00
|
|
|
|
|
|
|
SAML2
|
|
|
|
~~~~~
|
|
|
|
|
2017-08-08 06:19:33 +00:00
|
|
|
Please familiarise yourself with Shibboleth configuration and the general
|
2017-03-31 00:37:39 +00:00
|
|
|
flow of how to register a SP with an IDP.
|
|
|
|
|
2017-08-08 06:19:33 +00:00
|
|
|
If you send the SP metadata statically, validity time must be removed.
|
2017-03-31 00:37:39 +00:00
|
|
|
|
2017-08-08 06:19:33 +00:00
|
|
|
You will also need to register your IDP metadata here either statically or
|
2017-03-31 00:37:39 +00:00
|
|
|
remotely updated.
|
|
|
|
|
|
|
|
You may consider testing with testshib.
|
|
|
|
|
|
|
|
Configure signing and encryption keys, and configure them in the settings.py
|
|
|
|
|
2017-08-01 05:23:50 +00:00
|
|
|
Running a dev instance in Docker
|
|
|
|
--------------------------------
|
|
|
|
|
|
|
|
Assuming you have docker installed and working on your machine::
|
|
|
|
./make_dev_container.sh
|
|
|
|
|
|
|
|
will build you a container and run through the initial setup steps.
|
|
|
|
The last stage interactively creates a superuser account: you'll need
|
|
|
|
to interact with this for it to finish.
|
|
|
|
|
|
|
|
Once this has completed, you can hit http://localhost:28000/admin to
|
|
|
|
log into the admin interface. Once you're logged in,
|
|
|
|
http://localhost:28000 will take you to the dashboard.
|
|
|
|
|
|
|
|
Note that when you do this you're logged in as a superuser, so what
|
|
|
|
you see will be different from what a normal user will see.
|
|
|
|
|
|
|
|
Making migrations
|
|
|
|
~~~~~~~~~~~~~~~~~
|
|
|
|
|
|
|
|
If you make changes to the data model, you'll need to run "manage.py
|
|
|
|
makemigrations" to create a matching migration file. If you're on a
|
|
|
|
mac, or a system without python3, this can be difficult. In such a
|
|
|
|
case, the ``makemigrations.sh`` script takes advantaged of a docker
|
|
|
|
container that's slightly modified, and runs the makemigration action
|
|
|
|
on the files in your working directory.
|
|
|
|
|
|
|
|
|
|
|
|
Running a dev instance in a VirtualEnv
|
|
|
|
--------------------------------------
|
2017-03-31 00:37:39 +00:00
|
|
|
|
|
|
|
Not all things are lovely, so we use constraints to force the versions we
|
|
|
|
we wish for without having to do anything ugly. This may require a newer
|
2017-07-02 01:01:46 +00:00
|
|
|
version of pip than is packaged with distros virtualenv.
|
2017-03-31 00:37:39 +00:00
|
|
|
|
2017-07-02 01:01:46 +00:00
|
|
|
Note that this application is python 3 only so you must create your virtualenv
|
2017-08-08 06:19:33 +00:00
|
|
|
with a python3 interpreter.
|
2017-07-02 01:01:46 +00:00
|
|
|
|
2017-09-29 13:13:37 +00:00
|
|
|
- ``python3 -m venv venv``
|
2017-07-02 01:01:46 +00:00
|
|
|
- ``source ./venv/bin/activate``
|
2017-03-31 00:37:39 +00:00
|
|
|
- ``pip install -c constraints.txt -r requirements.txt``
|
2017-09-29 13:13:37 +00:00
|
|
|
- ``pip install -c constraints.txt -r vendored_requirements.txt``
|
2017-03-31 00:37:39 +00:00
|
|
|
|
2017-08-01 05:23:50 +00:00
|
|
|
Once your dev instance is up and running
|
|
|
|
----------------------------------------
|
|
|
|
|
2017-03-31 00:37:39 +00:00
|
|
|
Pre-post-start configuration
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
|
|
|
Now that we are ready to start the app, we need to do initial setup, start
|
|
|
|
it, perform voodoo string magic, run more database jingling voodoo, and then
|
|
|
|
we can start it up and start looking around and customising the application.
|
|
|
|
|
|
|
|
``./manage.py migrate``
|
|
|
|
``./manage.py runserver``
|
|
|
|
|
|
|
|
Now we hit up the admin interface, find `symposion_proposals` `proposalkind`
|
|
|
|
and add `Talk` slug `talk`, `Tutorial`:`tutorial`, and `Miniconf`:`miniconf`.
|
|
|
|
|
|
|
|
Shut down and now run:
|
|
|
|
``./manage.py populate_inventory``
|
|
|
|
|
|
|
|
Now you can run the system and see how it goes.
|
2017-06-10 02:34:39 +00:00
|
|
|
|
2017-08-01 05:23:50 +00:00
|
|
|
Admin tasks
|
|
|
|
-----------
|
|
|
|
|
2017-06-10 03:18:54 +00:00
|
|
|
Admin Credentials
|
|
|
|
~~~~~~~~~~~~~~~~~
|
|
|
|
|
|
|
|
To create a local administrator account run:
|
|
|
|
|
|
|
|
``./manage.py createsuperuser``
|
|
|
|
|
|
|
|
and enter your username, email and password. This can then be used to login to: (http://localhost:8000/admin).
|
|
|
|
|
2017-06-10 02:34:39 +00:00
|
|
|
Base Data
|
|
|
|
~~~~~~~~~
|
|
|
|
|
|
|
|
On initial creation and whenever you reset the database you must reload the
|
|
|
|
basic data. This data is stored in the /fixtures directory. You can load this with:
|
|
|
|
|
2017-08-16 04:31:24 +00:00
|
|
|
``./manage.py loaddata ./fixtures/{conference,proposal_base,sites,sitetree}.json``
|
|
|
|
|
|
|
|
And to load the base admin users:
|
|
|
|
|
|
|
|
``./manage.py loaddata ./fixtures/admin_users.json``
|
|
|
|
|
|
|
|
admin1:Inq4JVQyQvWnqXDI
|
|
|
|
|
|
|
|
admin2:w0jYMJsM4S+1zHds
|
|
|
|
|
|
|
|
admin3:XzynbNH9Sw3pLPXe
|
2017-07-08 04:37:38 +00:00
|
|
|
|
|
|
|
Creating review permissions objects
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
2017-09-29 13:13:37 +00:00
|
|
|
After conference Sections have been created, this command will add
|
|
|
|
Permission objects for those sections.
|
2017-07-08 04:37:38 +00:00
|
|
|
|
|
|
|
``./manage.py create_review_permissions``
|