This is a template that can be used with the UE4 GraphQL Plugin in order to make a near complete backend for your videogame. A few steps are involved in setting this up. It uses the following stack:
REACT-GRAPHQL/APOLLO-PYTHON/DJANGO-POSTGRESQL
On both your settings.py and your settings_dev.py, do the following: A: Generate a secret key for your django app B: Setup your PostgresSQL Database. If you are using CPanel, you must follow a special format where the servername is part of the name of the postgres database C: SERVER ONLY Set your static root and media root based on your server name D: ONLY IF YOU HAVE SETUP SMPT Set up your smtp at GRAPHQL_AUTH and at the end of the settings files E: ONLY WHEN LAUNCHING TO PRODUCTION Change the settings file from the default one (settings_dev.py) to the server one (settings.py)
A: Setup your PostgreSQL Database on your server (You can follow any online tutorial but MAKE SURE TO WRITE DOWN the database name, and create an account. Then use those credentials in your settings.py (the server settings file) to make this work. Also check the correct port is used. Without this step the backend won't work!
B: Upload your files and create a python app in the directory you uploaded. Make sure to copy the CMD command for step 2 C: Go to your terminal and paste the CMD Command. Then type the following:
- python manage.py makemigrations
- python manage.py migrate
- python manage.py collectstatic
- python manage.py runserver
This will finish your server setup.
C: Lastly check your url www.*MyURL*.com/graphql/ if it is working, success! If not, ask ChatGPT or google it bro