Giter Site home page Giter Site logo

isl-ideas-old's Introduction

isl-ideas


Congratulations on your new mo-django project!

Below you will find instructions on how to bootstrap the project. This README should be updated to reflect the current state of the project, with any additions or modifications to the setup procedures or other items of note.

Now just delete this block and let's get going!


Developing

Requirements

Python and Django

First you need to configure your environment:

cp env.example .env

Edit .env and set the values you need to run the project locally. When you start working on the project, run source .env or use autoenv to load the environment variables.

Next, create a Python 3 virtual environment and install the requirements:

mkvirtualenv --python=$(which python3) isl-ideas
pip install -r requirements.txt

Create the database specified in .env, run the initial model migration, and create a super user:

createdb islideas
foreman run python manage.py migrate
foreman run python manage.py createsuperuser

Front End Tools

Use nvm to install the correct version of Node.js and install the front-end dependencies:

nvm install
npm install

Do an initial build of assets:

gulp build

Running the Project

First load the virtualenv:

workon isl-ideas

Then use foreman (or forego) to run the development processes:

foreman start -f Procfile.dev

Procfile.dev defines the following processes:

  • web: the Django development server
  • static: the gulp watch process

foreman start -f Procfile.dev will start all of the processes at once. If you want to run a specific process, you can specify it directly:

foreman start -f Procfile.dev web

Procfile

When deployed to production or staging, the application and any other processes will be run as defined in the Procfile. You can run this file locally using foreman to launch the application the same way it will be run in production:

foreman start

You are highly encouraged to do this before finishing features to make sure the app runs as expected before it is deployed.

Deploying the Project

Set Environment Variables

Environment Variable Description
DEBUG True in development, False otherwise
SECRET_KEY Set this to a different value in every environment
ALLOWED_HOSTS comma separated list of allowed domains
DATABASE_URL database config URI
SSLIFY_DISABLE disables SSL check when True

Deploying on Heroku

In addition to deploying the project, some additional steps are necessary for deployment to Heroku.

Multiple Buildpacks

In order to build static assets, we'll include the nodejs buildpack in addition to the Python buildpack.

heroku buildpacks:set https://github.com/heroku/heroku-buildpack-python
heroku buildpacks:add --index 1 https://github.com/heroku/heroku-buildpack-nodejs

For more information, see Heroku's multiple buildpack guide.

Database

heroku addons:create heroku-postgresql:hobby-basic

Scheduler

Heroku provides a basic scheduled task runner, but don't worry about installing it unless you project needs one.

heroku addons:create scheduler:standard

To create a new scheduled task, run:

heroku addons:open scheduler

The scheduler admin will open in your browser, then click the Add new job button.

HTTPS

All projects should use HTTPS in production. Some projects will terminate on Heroku, others on CloudFront. Ask your system administrator if Heroku SSL is right for you.

heroku addons:create ssl:endpoint

Follow the SSL Endpoint documentation to upload the custom cert and finish configuration.

isl-ideas-old's People

Contributors

sarahjaine avatar

Watchers

 avatar

isl-ideas-old's Issues

Time Zone

Change timezone display on ideas/commment/vote to be dependant on user location

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.