Giter VIP home page Giter VIP logo

database's Introduction

database

database research for master thesis


๐Ÿ“ Prerequisites

Make sure Docker and docker-compose are installed successfully.

That's all! ๐Ÿณ

๐Ÿ Usage

  1. Navigate to database/backend folder. Copy .env.example to .env and set DJANGO_SETTINGS_MODULE to:
  • DJANGO_SETTINGS_MODULE=database.settings.development
  1. Navigate to database folder and run:
make

It will:

  1. Create Docker images (if not created previously).
  2. Run docker-compose up, who will launch all Docker containers.

Then you can:

  • Visit http://127.0.0.1:8000 to enter the public view.
  • Visit http://127.0.0.1:8000/admin/ to enter the Django Admin.

If is the first time running the project, you might get an error telling you something like [...]relation "django_session" does not exist. This is because we need to run Django migrations:

make init # While Django container is up!

Check Makefile for additional utility commands.


โœ… Testing

Run the whole test suite (including Jest and Django Test cases):

make test # same as `make front-test` and `make back-test`

๐Ÿ”จ Using local Django

If you're developing Django, you could prefer to use you local virtual environment over the default Docker setup.

In order to do that, you can run only Node and Postgre containers with:

make run-without-django

Then, you can start Django in your local virtual environment.

๐ŸŒ Translating

In order to translate to catalan or spanish you can generate the .po files with the respectively commands:

make translate-ca
make translate-es

It will generate a folder called locale that will contain folders with each language. Inside them will be a django.po file ready to be translated by you. Once upon they are translated, you can compile this translations with:

make compile-translations

It will generate finally django.mo files that allow Django to translate in execution time.

Considerations:

  • You need to install the python module in your environment:
cd backend/database
pip install -r requirements-dev.txt
  • Properly set environment variables in order to tell Django how to connect to the dockerized database and where settings are placed:
export DJANGO_LOCAL=True
export DJANGO_SETTINGS_MODULE=database.settings.development
  • All Makefile commands are prepared to work with the dockerized Django. If you're developing with a local Django, you must know the usage of manage.py and execute the commands manually. You can find examples in the Makefile or docker-compose.yml files.

๐Ÿ”จ Debugging external devices

If you're developing on external devices or you want a remote connection to your docker to be possible you must edit config.js and modify devServer with your network IP

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.