Code Monkey home page Code Monkey logo

pegasus_deneme's Introduction

Smart review

The most amazing SaaS application the world has ever seen

Installation - Docker

The easiest way to get up and running is with Docker.

Just install Docker and Docker Compose and then run:

make init

This will spin up a database, web worker, celery worker, and Redis broker and run your migrations.

You can then go to localhost:8000 to view the app.

Note: if you get an error, make sure you have a .env.docker file, or create one based on .env.example.

Using the Makefile

You can run make to see other helper functions, and you can view the source of the file in case you need to run any specific commands.

For example, you can run management commands in containers using the same method used in the Makefile. E.g.

docker compose exec web python manage.py createsuperuser

Installation - Native

You can also install/run the app directly on your OS using the instructions below.

Setup a virtualenv and install requirements (this example uses virtualenvwrapper):

mkvirtualenv smart_review -p python3.11
pip install -r dev-requirements.txt

Set up database

If you are using Docker you can skip these steps.

Create a database named smart_review.

createdb smart_review

Create database migrations:

./manage.py makemigrations

Create database tables:

./manage.py migrate

Running server

Docker:

make start

Native:

./manage.py runserver

Building front-end

To build JavaScript and CSS files, first install npm packages:

Docker:

make npm-install

Native:

npm install

Then build (and watch for changes locally):

Docker:

make npm-watch

Native:

npm run dev-watch

Running Celery

Celery can be used to run background tasks. If you use Docker it will start automatically.

You can run it using:

celery -A smart_review worker -l INFO

Or with celery beat (for scheduled tasks):

celery -A smart_review worker -l INFO -B

Updating translations

Docker:

make translations

Native:

./manage.py makemessages --all --ignore node_modules --ignore venv
./manage.py makemessages -d djangojs --all --ignore node_modules --ignore venv
./manage.py compilemessages

Google Authentication Setup

To setup Google Authentication, follow the instructions here.

Twitter Authentication Setup

To setup Twitter Authentication, follow the instructions here.

Github Authentication Setup

To setup Github Authentication, follow the instructions here.

Installing Git commit hooks

To install the Git commit hooks run the following:

$ pre-commit install --install-hooks

Once these are installed they will be run on every commit.

For more information see the docs.

Running Tests

To run tests:

Docker:

make test

Native:

./manage.py test

Or to test a specific app/module:

Docker:

docker compose exec web python manage.py test apps.utils.tests.test_slugs

Native:

./manage.py test apps.utils.tests.test_slugs

On Linux-based systems you can watch for changes using the following:

Docker:

find . -name '*.py' | entr docker compose exec web python manage.py test apps.utils.tests.test_slugs

Native:

find . -name '*.py' | entr python ./manage.py test apps.utils.tests.test_slugs

pegasus_deneme's People

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.