Giter Site home page Giter Site logo

wschuell / duopolydjango Goto Github PK

View Code? Open in Web Editor NEW

This project forked from aureliennioche/duopolydjango

0.0 3.0 0.0 6.82 MB

Server part of Duopoly Game. Based on Django framework.

Python 25.97% Shell 0.16% CSS 26.49% JavaScript 36.27% HTML 11.11%

duopolydjango's Introduction

DuopolyDjango

Server part of Duopoly Game. Developed using Django web framework.


How to (local)

Python dependencies (maybe incomplete)

  • django-bulk-update
  • django-crispy-forms
  • django-bulk-update
  • psycopg2-binary
  • click
  • numpy

PostgreSQL (MacOs)

install postgresql

brew install postgresql

run pgsql server

pg_ctl -D /usr/local/var/postgres start

create user and db

createuser dasein
createdb DuopolyRefactor --owner dasein

if you need to reset the table contents

psql DuopolyRefactor -a -f reset.sql

if you need to remove the db

dropdb DuopolyRefactor

Django

create superuser

python manage.py createsuperuser

django migrations

python manage.py makemigrations
python manage.py migrate

Then run the server

python manage.py runserver

Go to the interface at 127.0.0.1:8000 and create a room (room management tab). To play alone, trial parameter must be checked. You should now be able to join the game using the Unity client.

How to (server)

Take a dump

pg_dump -U dasein DuopolyRefactor > dump_$(date +%F).sql

Convert postgreSQL to SQLite

java -jar pg2sqlite.jar -d <DB_dump> -o <sqlite_filename>

Services required to run the game server in production

  • nginx
  • duopoly
  • postgresql
  • postgresql_dir (just once after start up)

The production server runs using the script run_server

Services required to run the game server in development

  • duopoly_django
  • postgresql
  • postgresql_dir (just once after start up)

The development server runs using the command (contained in duopoly_django service)

python manage.py 0:8000 |& tee -a log/$(date +%F).log &

Start and stop a service

sudo systemctl start <service>
sudo systemctl stop <service>

duopolydjango's People

Contributors

aureliennioche avatar bsgarcia avatar wschuell avatar

Watchers

 avatar  avatar  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.