We send a link at the user registration to verify the email address. In order to do this, the app need a SMTP server (we used SendGrid locally). There are 2 possibilities to test the email functionality:
- Use the Django Console backend
- Configure a SMTP server
The project uses by default django.core.mail.backends.console.EmailBackend. The emails will be print in the console stdout instead of sent over SMTP. See https://docs.djangoproject.com/en/1.9/topics/email/#console-backend for details.
Set the following environment variables before running the project:
export EMAIL_BACKEND="django.core.mail.backends.smtp.EmailBackend"
export EMAIL_HOST="SMTP host"
export EMAIL_HOST_USER="SMPT user"
export EMAIL_HOST_PASSWORD="SMPT user"
export EMAIL_PORT="SMPT port" # if not 587
export EMAIL_USE_TLS="SMPT use TSL" # if not TrueClone this repository
git clone https://github.com/WebTech2-Group123/django-assignment.git
cd django-assignmentCreate a virtual environment for Python 3.4
virtualenv --no-site-packages -p /usr/bin/python3.4 env
source env/bin/activateInstall dependencies
pip install -r requirements.txt Run the project
cd blog
python manage.py migrate
python manage.py createsuperuser # optional, only if you need it
python manage.py runserverOpen a browser at http://localhost:8000/
- Blog:
- see posts
- add post
- login
- Third Party Package
- Test model unit
- Functional Test (optional)
- login
- add post
- check new post's list