How To Use FormsenderΒΆ
In conf.py.dist there are several settings that Formsender relies on. To use these settings copy them to a new conf.py file in the root directory. You can change the following variables to match your setup:
EMAIL = u'email@example.com'
TOKN = u's0m3T0k3n$tr1ng'
CEILING = 10
DUPLICATE_CHECK_TIME = 3600
HOST = "0.0.0.0"
PORT = 5000
SMTP_HOST = "smtp.osuosl.org"
FROM = "formsender@osuosl.org"
EMAILis where the form data will be sent.TOKNis the validating token from the form. This must match a hidden field in your form called ‘tokn’. You can find and set theTOKNvariable in your conf.py file. Just make sure you also set the hiddentoknfield value to match.CEILINGis the maximum number of submit requests formsender will accept per second.DUPLICATE_CHECK_TIMEis the time (in seconds) to check past form submissions for duplicate submissions.HOSTandPORTis where therun_simplelistener listens for POST requestsSMTP_HOSTsets the host for thesendmailfunction. Must be a smtp serverFROMis the address the email will be sent from
You can run flake8 on request_handler (the application):
$ make flake
Once a valid conf.py file exists, tests can be run:
$ make tests
To run the application locally for development purposes:
$ make run
The app will now wait at HOST:PORT for the form to be submitted, and
will email the information submitted to the email specified. HOST and
PORT can be changed in conf.py to match your desired setup.