Giter Club home page Giter Club logo

caproverdj's Introduction

caproverdj

A basic web app to showcase django deployment with caprover

Built with Cookiecutter Django Black code style
License:MIT

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.

Type checks

Running type checks with mypy:

$ mypy caproverdj

Test coverage

To run the tests, check your test coverage, and generate an HTML coverage report:

$ coverage run -m pytest
$ coverage html
$ open htmlcov/index.html

Running tests with py.test

$ pytest

Live reloading and Sass CSS compilation

Moved to Live reloading and SASS compilation.

Deployment

The following details how to deploy this application.

Setup

During the setup we will refer to the django app as demo-django, the redis app as demo-redis and the prostgre app as demo-db.You may change this names to your liking

1) Assumptions

The following assumptions are made about your environment: - You have a working CapRover - You have read and understood the basic CapRover documentation - You have ssh access to you CapRover server - You have configure a gmail app

2) CapRover

  • Create a postgres app from the one-click wizard

  • Choose demo for the name as this will automatically be prefixed with -db

  • Note username, database and password

  • same process for the redis app but only fill the name form

  • Create a new blank app with the name demo-django

  • In the App Configs tab, toggle the bulk edit for environment variables and then paste the section below. Fill in the values in bracket. The app name is the name provided by caprover, it usually starts with srv-.

    DJANGO_DEBUG=False DJANGO_SECRET_KEY=YOUR_SECRET_KEY DJANGO_SETTINGS_MODULE=config.settings.production DJANGO_ADMIN_URL=A_RANDOM_LONG_URL DJANGO_ALLOWED_HOSTS=YOUR_APP_DOMAIN_NAME DATABASE_URL=postgresql://{postgres_user}:{postgres_pass}@{postgres_app_name}:5432/{postgres_db_name} REDIS_URL=redis://:{redis_password}@{redis_app_name}:6379 EMAIL_HOST_USER=YOUR_GMAIL_APP_USER EMAIL_HOST_PASSWORD=YOUR_GMAIL_APP_PASSWORD

3) Django

  • Deploy the code from this repository with your method of choice to demo-django

  • Open a ssh session to demo-django by typping

    docker exec -it $(docker ps --filter name=your_demo_app_name -q) /bin/sh
    
  • Create a superuser by executing python manage.py createsuperuser

Source

This caprover setup is based on: https://gitlab.com/kamneros/caprover-django

caproverdj's People

Contributors

tobi-de avatar

Stargazers

 avatar  avatar

Watchers

 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.