To sucessfully run this Django project you will need the following programs:
-
Install Python 3.6.5
-
Type command on cmd.exe
pip install virtualenvwrapper-win
Note: This installs a virtual enviroment to install python library without needing to mess up your PATH environment variable on windows.
-
Creating a virtual environment:
mkvirtualenv myproject
Note: This creates a virtual enviroment for a python project. the folder 'myproject' will be under a folder called Envs.
-
Initializing the virtual environment(VE):
workon myproject
Note: Initializes virtual environment. Doing so will activate any libraries that a user has installed using this virtual environment (such as Django)
-
Once VE has been initialized, install Django:
pip install Django
-
Install MariaDB
-
Install on Virtual Enviornment
mysqlclient
with fileNote: Once file has been downloaded go to file location and initialize the VE. Run command:
pip install <filename>
- If an error occurs regarding C++ 14.0 dependencies click link to install C++ 14.0 Build Tools
- If Error persists, Link up C++ 14.0 to your
PATH
variable:C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin
C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE
- If Error persists, Link up C++ 14.0 to your
- Go to
retroGame/retroGame/settings
and change DATABASE to
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'USER': 'root',
'NAME': '$DATABASE',
'PASSWORD': '$PASSWORD',
'PORT': '3306',
#'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
}
}
$DATABASE
: Database in your MariaDB server$PASSWORD
: Password for the root user
- Run the Django Server:
python manage.py runserver
- Start the django server on localhost:
python manage.py runserver
- Accessing django shell for database:
python manage.py shell
- If database has changed:
python manage.py inspectdb > retoGameWeb/models.py