License: | GPLv3 |
---|
To create a normal user account, just go to Sign Up and fill out the form. Once you submit it, you'll see a "Verify Your E-mail Address" page. Go to your console to see a simulated email verification message. Copy the link into your browser. Now the user's email should be verified and ready to go.
To create an superuser account, use this command:
$ python manage.py createsuperuser
For convenience, you can keep your normal user logged in on Chrome and your superuser logged in on Firefox (or similar), so that you can see how the site behaves for both kinds of users.
Running type checks with mypy:
$ mypy desafio_ibm
To run the tests, check your test coverage, and generate an HTML coverage report:
$ coverage run -m pytest $ coverage html $ open htmlcov/index.html
$ pytest
This app comes with Celery.
To run a celery worker:
cd desafio_ibm
celery -A config.celery_app worker -l info
Please note: For Celery's import magic to work, it is important where the celery commands are run. If you are in the same folder with manage.py, you should be right.
In development, it is often nice to be able to see emails that are being sent from your application. For that reason local SMTP server MailHog with a web interface is available as docker container.
Container mailhog will start automatically when you will run all docker containers.
With MailHog running, to view messages that are sent by your application, open your browser and go to http://127.0.0.1:8025
To access the e-mail during development tests
http://localhost:8025 (mailhog)
- Módulo
django.contrib.auth
- Módulo
django.utils.translation
- Módulo
django.contrib.auth.models.AbstractUser
- Templatetags
- Generic views
- Jquery
- chzn-chosen select
- Bootstrap
- Docker
- Docker-compose
- Nginx
- Celery
- Postgres
- I18N (Django)
- Enviroment Variables
- Markdown
- Pip
- gunicorn
- CSS
- Javascript
- PGBouncer
- Adminer (dev)
- Mailhog
- Redis
- Docs
- Code Style Black.
To build the appplication:
docker-compose -f local.yml build
To run the aplication with docker
docker-compose -f local.yml up -d
Access the container to populate the cities and states:
docker exec -ti django bash
Add the following enviroments variables in the container:
export CELERY_BROKER_URL="${REDIS_URL}"
base_postgres_image_default_user='postgres'
export POSTGRES_USER="${base_postgres_image_default_user}"
export DATABASE_URL="postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DB}"
Run:
python manage.py runscript set_cities
python manage.py runscript set_states
Access with browser: