GithubHelp home page GithubHelp logo

jamilatta / desafio_ibm Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 289 KB

Desafio IBM (Pet Finder)

License: BSD 3-Clause "New" or "Revised" License

Dockerfile 2.23% Shell 2.45% Python 27.06% CSS 5.92% JavaScript 35.27% SCSS 0.21% HTML 17.04% Makefile 0.32% Batchfile 0.36% XSLT 9.14%

desafio_ibm's Introduction

Desafio_ibm

Black code style
License:GPLv3

Basic Commands

Setting Up Your Users

  • 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.

Type checks

Running type checks with mypy:

$ mypy desafio_ibm

Test coverage

To run the tests, check your test coverage, and generate an HTML coverage report:

$ coverage run -m pytest
$ coverage html
$ open htmlcov/index.html

Running tests with py.test

$ pytest

Celery

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.

Email Server

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)

Components and technologies:

  • 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.

Docker

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:

http://localhost:8000

desafio_ibm's People

Contributors

jamilatta avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.