Almad / crystal-ball

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Crystall Ball build status

Do you know where this is?

Do I have a crystall ball or what?

-- Unknown Developers

Installation

cp crystal_ball/settings/local-dist.py crystal_ball/settings/local.py

Look into local settings.

docker-compose run web python manage.py syncdb

After altering dependency chain (like adding a line to requirements.txt), run

docker-compose build web

Running

django-compose up

See browser at http://127.0.0.1:8000

Initial set up

to be automated...

  1. Head to Google Developer Console, create a new project for your installation or development, go to "API Manager" -> "Credentials" -> Add Credentials on that project, select "OAuth 2.0 Client ID", "Web Application" and use http://127.0.0.1:8000/accounts/google/login/callback/ for "Authorized redirect URIs".

  2. Go to your django admin and login with credentials you've entered during syncdb step

    1. Go to "Sites", click on existing "example.com" site and change the domain name to 127.0.0.1:8000 (or wherever you are running)

    2. Go to "Social applications" and add a new application with Google as a provider, credentials you've received from Google Developer Console and connected with the site from previous step

Development

After altering dependency chain (like adding a line to requirements.txt), run

docker-compose build web

After modifying models.py:

docker-compose run --rm --user "$(id -u):$(id -g)" web python manage.py makemigrations docker-compose run --rm --user "$(id -u):$(id -g)" web python manage.py migrate

Testing

docker-compose run --rm --user "$(id -u):$(id -g)" web python3 manage.py test

If you want to test with different IP addresses at runtime, add line like

IP_OVERRIDE=8.8.8.8

to file called .env that is in the root of the repository, and add env_file: .env to your docker-compose.yml (if you have better way how to propagate environment variables downstream, please let me know).

Attribution

This product includes GeoLite data created by MaxMind, available from MaxMind.

About

License:MIT License


Languages

Language:Python 44.0%Language:HTML 27.1%Language:CSS 17.2%Language:Nginx 7.2%Language:Shell 3.4%Language:JavaScript 1.1%