-
Notifications
You must be signed in to change notification settings - Fork 0
Initial Installation
The precise details of installing a Django app under your web server will depend a bit by Web Server and Operating System.
You can download the code using git itself, or download one of the formal releases. I'd only recommend using git itself if you know what you are doing with that tool.
First you will need to select an Operating System and Environment. Django apps can run on most Operating Systems, with most Web Servers and with most Database Backends.
One possibility is Debian GNU/Linux, in which case, install
aptitude install apache2 python3-django libapache2-mod-wsgi-py3
will probably get most of the packages you want. On a Debian system, custom software should be installed under
/usr/local/share
so you should unpack the code there. But the precise details vary. You might find this example useful.
Once you have the software installed, you should edit settings.py
to at least change the secret, and probably your database to the values you desire. Details here. Note that out of the box the choice will be sqlite, which may be a poor choice for production.
You will need to create the database schema, do this with
python3 manage.py migrate
while in the directory with manage.py
. This creates the schema, but you may find it useful to populate some very basic default configuration. This can be done with
python3 manage.py populate_database --add-core-config -v 3
which will add some Categories, Activity Types, Module Sizes and a basic AssessmentState workflow.
You may find it useful to populate some test data to let you play with the system. You can do this with
python3 manage.py populate_database --add-test-data -v 3
which will create a WorkPackage, and a Group and some staff, by default using "TEST" as a prefix. You can use the optional --test-prefix to change this, which can be useful if you want several distinct test data sets. The users created can't log in directly.
python3 manage.py create_superuser
will create a superuser account. You should now be able to login, but may not be able to see anything. Click on the Admin Interface and go to Users. Add your Superuser account to the Groups you want to be able to see (particularly if you created test data above). You should now be able to see and manipulate data.