MindSystemBackend
It is recommended that you fork this project and then clone it for development.
It is recommended that you use Anaconda to create virtual environments.
python >= 3.7 is recommended
Run pip install -r requirements.txt
to install dependencies.
All versions may work, but we only tested on version 8.0.29.
After you have finished installing mysql, be sure to add the installation directory to your environment variables.
You can run mysql -uroot -p
to confirm that the installation is complete.
Then run create databases <database_name>
to create a new database where the recommended name for the <database_name>
is mind_system_mysql_db
Download Docker Desktop on offical website.
Then run docker pull chamberharr/fmedetection:v1
to pull the docker image.
Download file FERMoudle.7z in Google Drive or Baidu Netdisk. Then unzip it to the project root directory.
Use docker run to create container from image.
docker run --env=PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin --volume=.\FERMoudle:/home/FERMoudle --volume=.\VideoData:/home/FERMoudle/VideoData --runtime=runc --name=FERModule -dit chamberharr/fmedetection:v1
Hint: --volume is based on your system.
Then run docker start FERModule
to start the container.
- Create a file
settings_<your_name>.py
in MindSystemBackend folder. You can referencesettings_yuji.py
and Tutorial. Change the database configuration information. - Make a Symbolic link
settings.py
tosettings_<your_name>.py
. E.g.ln -snf settings_<your_name>.py settings.py
for Linux/MacOSX.mklink settings.py settings_<your_name>.py
for Windows CMD.New-Item -ItemType SymbolicLink -Path settings.py -Target .\settings_<your_name>.py
for Windows Terminal. - Run
python manage.py migrate
to migrate the database. - Run
python manage.py createsuperuser
, then create a user. If raise python exception, please modify the error line fromquery = query.decode(errors='replace')
toquery = query.encode(errors='replace').decode(errors='replace')
- Run
python manage.py runsslserver 0.0.0.0:8080
- The main page url of this project is https://localhost:8080/ARPicture/login/
- Use superuser to login.
- Django databases page url is https://localhost:8080/admin/. You can create new user here.
- Check your phone/pad is at the same local network with your server.
- Use your phone/pad visit https://x.x.x.x:8080
- Login and follow the prompt message.
Hint: Based on Linux/MacOSX
pip3 install virtualenv
mkdir -p /app/ENV/
cd /app/ENV
virtualenv django-2.2-tutorial
source django-2.2-tutorial/bin/activate
- (now you should see django-2.2-tutorial in the prompt, meaning you are inside the virtualenv)
pip3 install django==2.2.27
pip3 install pylint #make sure use the pylint in virtualenv would be used
pip3 install pylint-django
pip3 install django-sslserver
(add at 2022/08/08 to run ssl server)
Windows
click here to learn how to activate virtualenv
Then fllow the step 7-10. (maybe use pip instead of pip3)
Hint: May use python
instead of python3
command if show error in Windows
- clone
- cd root dir
- if this is first time to start project or have change the database, try
python3 manage.py makemigrations
andpython3 manage.py migrate
python3 manage.py runserver 0.0.0.0:8080
- open browser and goto: http://localhost:8080
- activate the virtualenv
pip/pip3 install django-sslserver
python3 manage.py runsslserver 0.0.0.0:8080
- open browser and goto: https://localhost:8080
- check your ip and use other device in same LAN and goto: https://x.x.x.x:8080
- find the file MindSystemBackend/urls.py
- find the include file in url patterns. e.g.:ARPictureBook.urls
- find the url pattern in the file of step 2.
- concat the final url. e.g.: localhost:8080/ARPicture/start
- The admin site is http(s)://localhost:8080/admin
- Create super user in terminal by use command
python3 manage.py createsuperuser
- Create your own model in file models.py
- Registe your model in file admin.py
- Login admin site, then you can see all your registed model there.
- Try to move ARPictureBook from node server to Django. --via. Charles 2022/08/07
- Finish add start page, try to add second and third page, code review today later. --via. Charles 2022/08/08 morning
- Finish add second and third page, code review, find mobile phone must use ssl server to use camera. --via. Charles 2022/08/08 night
- Try to use ajax to send data from frontend to backend, quick demo. Use UnderScoreCase in backend, keep CamelCase in frontend. --via. Charles 2022/08/09
- Create models to save the query result. --via. Charles 2022/08/11
- Finish save result logic. --via Charles 2022/08/12