Skip to content

Spam-Number-Filter/Spam-Filter-WebPage

Repository files navigation

Spam Filter Web Page ☎️

Flake8 Linter Unit Tests Behavior Tests Deploy to Heroku

Summary

Getting Started πŸ”

These instructions will give you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on deploying the project on a live system and the docker notes for running the project on a container.

First of all, be aware that it is recommended to create a python virtual environment for installing the project dependencies! After you have created the environment, run the following command for installing the running dependencies:

pip install -r requirements.txt

If you want to install the development dependencies (which installs the linter, test runner, test coverage tools, etc) run the following command:

pip install -r .github/dev-requirements.txt

Once installed, you have to run the following commands for creating and migrating the database:

python manage.py collectstatic --noinput
python manage.py migrate --run-syncdb 
python manage.py migrate

Finally, you can run the server with the following command:

python manage.py runserver

In order to access the sqlite database as admin, the already created superuser can be used. The credentials are the following:

User: admin

Password: admin

Running with docker and using postgres as database 🐳

First, build the docker image with the following command:

docker-compose build

Then, start the docker container with the following command:

docker-compose up

When booting the containers (both the project one and the data base one) for the first time, it may fail due to bad order of execution. If that happens, booting a second time should fix it. When the docker has finished booting and everything is okey, there will be an instance of django running on localhost at port 8000.

Adding a DB superuser inside the docker container πŸ‘€πŸ’Ύ

Before accessing the data base (as admin), an admin user must be created. In order to create it inside the django instance use:

docker exec -it django python manage.py createsuperuser

Deploy to Heroku 🌎

For deploying to heroku, we've configured two github workflows which are run in the following contexts:

  • Main workflow: When a commit get's pushed to the master branch, it will deploy the current branch to the heroku production environment.
  • Develop workflow: When a commit get's pushed to the develop branch, it will deploy the current branch to the heroku development environment.

License πŸ“–

The project is licensed under the GNU General Public License v3.0. See the LICENSE file for more information.

Contributing πŸ§‘β€πŸ€β€πŸ§‘

Please read the CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.