This project runs with docker
(you can use traditional virtualenv
but it's prepared out of the box for docker
). We choose Django 2.0
and Python 3.6
The database is a postgresql
. We use the django templates for this exercise, because it easy to manage all the app only with python
. However we prefer django-rest-framework
and a javascript framework
for a production escenario.
You need to install docker
and docker-compose
to run it. We use two images: python 3.6
and postgresql
. We have a Makefile
with some rules to manage the project. Some of them are: start
, stop
, dockershell
, shell_plus
, psql
, migrations
.
- To run tests and Flake8 inside of a container. Just run:
make test
- To start the project just run:
make start
This command will pull docker images and run them inside of a container.
- Then you need to setup the database and create a superuser. We have two targets:
make migrate
make superuser
- For google accounts, you need to configure the "Google login".
- Go to
localhost:8000/admin
and inside of it, go to Sites app:
and edit example.com
register with locahost:8000
like this img:
You can choose a diffent domain name if you want to deploy it in VM.
-
Go to https://console.developers.google.com/ and create new app and oauth2 credentials. You can follow this instructions
-
Go back to
localhost:8000/admin
and inside of it, go toSocial Accounts
/Social application
and fill it with the keys provided by google.