Coder Social home page Coder Social logo

cloudcruder_django's Introduction

CloudCruder

Setting up the app

Clone the repo.

First run:

❯ docker-compose build

Running the app

❯ docker-compose up

Open a browser to http://127.0.0.1:8000/

Enjoy the headaches 😁

How to

Create a Superuser

❯ docker-compose run --rm app sh -c "python manage.py createsuperuser"

Create apps

Create an empty folder with the apps name first in backend/apps/name_of_the_app then run:

❯ docker-compose run --rm app sh -c "python manage.py startapp name_of_the_app ./apps/name_of_the_app"

Makemigrations

❯ docker-compose run --rm app sh -c "python manage.py makemigrations"

Run Migrations

❯ docker-compose run --rm app sh -c "python manage.py migrate"

Open the shell

❯ docker-compose run --rm app sh -c "python manage.py shell"

Run tests

To run all the tests.

❯ docker-compose run --rm app sh -c "python manage.py test apps/*"

Or run the following for a specif app in the project.

❯ docker-compose run --rm app sh -c "python manage.py test apps/name_of_the_app"

Locally test deployment (prod)

❯ docker-compose -f docker-compose-deploy.yml down --volumes
❯ docker-compose -f docker-compose-deploy.yml build
❯ docker-compose -f docker-compose-deploy.yml up

❗️Don't forget to kill the "prod" volumes after testing. (Run the first command)

Create a Superuser when locally testing deployment (prod)

❯ docker-compose -f docker-compose-deploy.yml run --rm app sh -c "python manage.py createsuperuser"

Deploying in Prod

Deploying in Prod for the first time

❗️❗️❗️ After cloning the project on the production server, cd into cloudcruder folder and:

❯ cp .env.sample .env

Then update the everything except the DB_USER value.

Now you can run the app:

❯ docker-compose -f docker-compose-deploy.yml up -d

Deploying in Prod for updates

  • SSH to the server.
  • cd into cloudcruder folder
  • Pull the changes, run git pull origin main
  • Run the following commands:
❯ docker-compose -f docker-compose-deploy.yml build app
❯ docker-compose -f docker-compose-deploy.yml up --no-deps -d app

cloudcruder_django's People

Contributors

hemroda avatar

Watchers

 avatar

cloudcruder_django's Issues

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.