Website that serves as a database and framework for the ALES Project
- Install Python 3
- Install virtualenv (Accomplish this by running
pip3 install virtualenv
) - Install Postgres
- Open a terminal window at the project's root:
virtualenv -p python3 venv
to create a virtual machine for the website
source venv/bin/activate
to activate the virtual machinepip install -r requirements.txt
to install the requirementspython manage.py migrate
to migrate the databasepython manage.py createsuperuser
to create the website's admin. Take note of the username and password for laterpython manage.py collectstatic
to collect the staticfiles so that the app is self-contained
You can now start the server with python manage.py runserver
, but follow the local instructions below first to set your environment variables.
You can modify the settings directly or create a .env
to keep your local settings secret.
To use a .env
simply create a new .env
file at the root of the project and write the settings that you wish to alter, followed by their content.
A typical .env
for this project should look like this (some settings may be missing):
EMAIL_PASSWORD=supersecretpassword
[email protected]
DJANGO_SECRET=longstringofrandomcharacters
[email protected]
SITE_URL=http://localhost:8000
If you wish, just go to project/settings.py
and manually change the settings
Don't forget to erase your passwords before pushing changes, though!
SECRET_KEY
Django's signing key. No need to change it if running with DEBUG = True
SITE_URL
is the website's domain. If running locally, yours wil probably be something like http://localhost:8000
To properly sign users in the website uses a email verification system.
You'll need a valid email account to serve as host
DEFAULT_FROM_EMAIL
the default email address to be used as 'from' field
EMAIL_HOST_USER
email address that'll be used as host
EMAIL_HOST_PASSWORD
the password of the above host
You can leave EMAIL_USE_TLS
, EMAIL_HOST
and EMAIL_PORT
as is if you are using gmail
SERVER_EMAIL
the email address that django will use when sending error reports
ADMINS
List of tuples with admin names and emails. Used when sending error reports
Now you are all set.
To start the website, do python manage.py runserver
Start by going to the index page and clicking Login
Use your admin username and password to login
Now you'll see some options. Start at the top and create a City.
Proceed by creating schools, courses, etc. Create as many as you want.
Whenever you create a Teacher or a Student, a confirmation email is sent to them. Within it you'll find a unique confirmation url. Use it to activate and set a password for the teacher or student.
You'll now be able to login as the activated teacher or student and do some other things as them, like enroll in courses or create events.