This project demonstrates example usage of callisto-core. The hope is to encourage forks of callisto-core for domains other than U.S. college campuses.
LICENSE: GPLv3
This project adheres to a code of conduct(https://github.com/SexualHealthInnovations/callisto-core/blob/master/CONDUCT.md). By participating, you are expected to uphold this code. Please report unacceptable behavior to [email protected].
Install pip, virtualenv, virtualenvwrapper, and npm if you don't have them already.
Clone this repo.
Make a virtual environment:
$ mkvirtualenv --python=python3 callisto-sample-project
Install npm depenencies:
$ npm install
Install pip dependencies:
$ pip install -r requirements/local.txt
Make Callisto importable (may need to change the path to your virtual environment):
$ touch ~/.virtualenvs/callisto-sample-project/lib/python2.7/site-packages/callisto/__init__.py
Create a database:
$ createdb callisto-sample-project
Run the migrations:
$ ./manage.py migrate
Run your first development server:
$ npm start
Moved to settings.
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.
To run the tests, check your test coverage, and generate an HTML coverage report:
$ coverage run manage.py test $ coverage html $ open htmlcov/index.html
$ py.test
$ npm test
Install npm depenencies:
$ npm install
Start the development server:
$ npm start
A more detailed explanation for Developing locally with webpack
The static project readme contains a lot of information about React / Redux and Webpack for this project.
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. Please check cookiecutter-django Docker documentation for more details how to start all 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
Sentry is an error logging aggregator service. You can sign up for a free account at https://getsentry.com/signup/?code=cookiecutter or download and host it yourself. The system is setup with reasonable defaults, including 404 logging and integration with the WSGI application.
You must set the DSN url in production.
See detailed cookiecutter-django Heroku documentation.
See detailed cookiecutter-django Docker documentation.
Quick docker-compose guide (for development):
- Install Docker and docker-compose. Note: the Mac version of Docker comes with
docker-compose
included. - In one terminal, at the root of the project, run:
docker-compose -f dev.yml up --build postgres
. It will take some time for postgres to install the first time you run the command. The last line of output you will probably see will be something likepostgres_1 | LOG: autovacuum launcher started
orpostgres_1 | LOG: database system is ready to accept connections
. That indicates that postgres is ready and waiting. - In another terminal, also at the root of the project, run:
docker-compose -f dev.yml up --build mailhog npm django
. You may have to wait quite some time before webpack finishes building the bundle of static files. If you try to access the site before it's finished, you'll probably see a traceback forbuiltins.OSError: Error reading /app/webpack-stats.json. Are you sure webpack has generated the file and the path is correct?
. Once you seenpm_1 | webpack: bundle is now VALID.
, your django/npm/mailhog server is running. - If you want to run any
manage.py
command (likemigrate
orshell_plus
), ensure the django container is up, and then run
docker-compose -f dev.yml run django python /app/manage.py shell_plus
Note: You may need to prepend those commands with sudo.