Skip to content

LuanP/django_sites_web

Repository files navigation

Django Sites Web

Travis Coveralls github standard-readme compliant

A 3MW Application Task.

The task is to develop an application as shown on http://applicationtask.herokuapp.com. The requirements are as follow:

  • Django as web framework
  • Bootstrap as front-end framework
  • Keep the URL logic
  • Regarding the aggregations: please implement one in Python code and the other one as database query, using Django's database API over raw SQL.

Table of Contents

Background

This project was built and tested with Python 3.6.4.

It's recommended that you use docker-compose for running this project.

The project uses SQLite as testing database and Postgres for develop/stage/production environments.

Install

Just run:

docker-compose up

NOTE: If you want to develop any feature, make sure to run:

make install-development

This will set you some git-hooks to run flake8 and coverage before every commit and push.

Manual install

If you want it, it's recommended to create a virtualenv.

Create your database and user:

psql -c "CREATE USER your_user WITH PASSWORD 'your_password';" -U postgres
psql -c "CREATE DATABASE your_db;" -U postgres
psql -c "GRANT ALL PRIVILEGES ON DATABASE your_db TO your_user;" -U postgres

Copy the .env.sample and set the variables as you wish:

cp .env.sample .env
vi .env

Install and run the project:

make install-development

Usage

If you have chosen the path of happiness using docker-compose you will be set up and running only with the command of the previous section:

docker-compose up

Manual usage

python3 src/manage.py migrate
python3 src/manage.py loaddata sites  # optional: only if you want some previous data
python3 src/manage.py runserver 0.0.0.0:8000

Contribute

PRs accepted.

Small note: If editing the Readme, please conform to the standard-readme specification.

License

GNU General Public License v3.0

About

3MW Application Task

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published