MartijnWallage / ft_transcendence

ft_transcendence in development

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ft_transcendence

ft_transcendence in development

Hope this will help a little bit

Setting up Django in your Computer/Virtual Box

1. Install Python3 (If not installed Already)

2. Install pip3

3. Install pipenv using pip3

  a) pip3 install pipenv or
  b) sudo apt install pipenv(for me only this worked)

4. Go to the project folder and

 a) pipenv install django
 b) pipenv shell
 c) code .

5. Create a project Pong

django-admin startproject pong .

Run your Django Server

python manage.py startapp playpong
python manage.py runserver
("Deciding a port number is optional by default 8000")

Setting in the files to make Pong.js and Pong.html work

  • in settings.py append playpong

  • image

  • INSTALLED_APPS [

  • 'playpong'

  • ]

  • add this as well

  • image

    inside playpong Folder create 2 folder templates and static and put pong.js and pong.html

    image

    make these changes in pong.html

    image

    in playpong/views.py define a function like this

    image

    finally we need to have playpong/urls.py to call our function make it like this

    image

    Also inside the pong/urls.py make these changes

    image

IF the server is already running from before it will update itself after saving all files.

To start again

python manage.py runserver

Path to the pong game as described above

http://127.0.0.1:8000/playpong/hello/

About

ft_transcendence in development


Languages

Language:JavaScript 96.6%Language:Python 1.9%Language:HTML 0.9%Language:CSS 0.2%Language:Dockerfile 0.2%Language:Makefile 0.1%Language:Shell 0.1%