Git Product home page Git Product logo

teslarent's Introduction

teslarent

Translations

Preparation

  • Install npm
  • npm install grunt --save-dev
  • npm install grunt-angular-gettext --save-dev

Extract translations

PATH=$PATH:./node_modules/.bin grunt nggettext_extract

Translate

https://angular-gettext.rocketeer.be/dev-guide/translate/

Compile translations

PATH=$PATH:./node_modules/.bin grunt nggettext_compile

Setup

Choose between Docker, Generic Setup and Heroku

Docker

docker run -d -v $PWD/db:/var/lib/postgresql/data -p 5432:5432 --name teslarent-postgres postgres

docker build -t teslarent .
docker run -d -p 444:443 --link teslarent-postgres:postgres -e DJANGO_ALLOWED_HOST='*' -e DJANGO_SECRET_KEY=$DJANGO_SECRET_KEY --name teslarent teslarent

Production deployment

Environment variables

  • DATABASE_URL=postgres db config, e.g. postgres://postgres:[email protected]:5432/dbname
  • DJANGO_ALLOWED_HOST=your_domain
  • DJANGO_SECRET_KEY=random 50 symbol string, generate one with from django.utils.crypto import get_random_string; get_random_string(50, 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*(-_=+)')
  • these variables cannot be set in Apache with SetEnv, either set them as global environment variables or define them in ./project/settings_prod.py
  • make sure DJANGO_DEBUG is NOT set to True

Generic Setup

Requirements

Setup

  • Fetch source code and install requirements
git clone https://github.com/flarno11/teslarent.git
cd teslarent
git checkout release
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
cp project/settings_prod_sample.py project/settings_prod.py
  • Make sure config variables are set correctly before continuing, either in project/settings_prod.py or via global environment variables
  • Run checks and initialize database
export DJANGO_SETTINGS_MODULE=project.settings_prod
python manage.py check --deploy
python manage.py migrate
python manage.py collectstatic --no-input
  • Create admin user
python manage.py createsuperuser

and follow the instructions

  • Open https://your_domain/manage/ in your browser and login

Upgrade

  • Fetch updated source code and install new requirements if necessary
cd teslarent
git pull
source venv/bin/activate
pip install -r requirements.txt
export DJANGO_SETTINGS_MODULE=project.settings_prod
python manage.py migrate
python manage.py collectstatic --no-input
  • Reload web server, e.g. with service httpd reload

Setup using Heroku (heroku.com)

  • Create new app
  • Go to Resources, add Postgres database
  • Enable automatic deployment from this github repo, choose the release branch
  • From the command line
  • `export APP_NAME=your_heroku_app_name
  • heroku config:set --app $APP_NAME DJANGO_SETTINGS_MODULE=project.settings
    • do the same for DJANGO_ALLOWED_HOST and DJANGO_SECRET_KEY
  • Verify config with heroku config --app $APP_NAME
  • heroku run --app $APP_NAME python manage.py check --deploy
  • heroku run --app $APP_NAME python manage.py migrate
  • heroku run --app $APP_NAME python manage.py createsuperuser
  • Open https://your_domain/manage/ in your browser and login

teslarent's People

Contributors

dependabot[bot] avatar flarno11 avatar gmavrikas avatar

Watchers

 avatar  avatar  avatar

Forkers

gmavrikas

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.