Coder Social home page Coder Social logo

bluflowr / callisto-sample-project Goto Github PK

View Code? Open in Web Editor NEW

This project forked from samskeller/callisto-sample-project

0.0 1.0 0.0 1.62 MB

License: GNU Affero General Public License v3.0

Python 46.81% JavaScript 16.48% CSS 2.40% HTML 21.18% Shell 11.64% Nginx 1.50%

callisto-sample-project's Introduction

Callisto Sample Project

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.

Built with Cookiecutter Django Code Climate

LICENSE: GPLv3

Code of conduct

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].

Setting up a development environment

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

Settings

Moved to settings.

Basic Commands

Setting Up Your Users

  • 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.

Test coverage

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

Running tests with py.test

$ py.test

Running javascript tests with karma

$ npm test

Hot reloading with React and Webpack

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.

Email Server

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

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.

Deployment

Heroku

https://www.herokucdn.com/deploy/button.png

See detailed cookiecutter-django Heroku documentation.

Docker

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 like postgres_1 | LOG: autovacuum launcher started or postgres_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 for builtins.OSError: Error reading /app/webpack-stats.json. Are you sure webpack has generated the file and the path is correct?. Once you see npm_1 | webpack: bundle is now VALID., your django/npm/mailhog server is running.
  • If you want to run any manage.py command (like migrate or shell_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.

callisto-sample-project's People

Contributors

saradgore avatar aschn avatar cmutechops avatar mandx avatar kevindaum avatar mariatta avatar seachus avatar chriscauley avatar

Watchers

Irma Kramer avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.