Sepehr Safari 97108263
Sara Khosravi 97101586
Ghazal Shenavar 97101897
I couldn't fork the main repository of our group project because it's repository (Sharif Embedded Systems) is private. So, in this repository contributions are not defined.
- Go into the project dir:
cd raspberry_webserver
- Create a virtual environment:
python -m venv venv
- Activate the venv:
source venv/bin/activate
- Install requirements:
pip install -r requirements.txt
-
Build database. You can see the details in Build database section
-
Make migrations:
python manage.py makemigrations
- Migrate:
python manage.py migrate
- Create a super user (i.e. an admin):
python manage.py createsuperuser
-
install Mysql.
-
Create the user.
sudo mysql
> CREATE USER 'rasp_user'@'localhost' IDENTIFIED BY 'rasp_user';
> GRANT ALL PRIVILEGES ON * . * TO 'rasp_user'@'localhost';
> FLUSH PRIVILEGES;
> exit
- Create the database.
mysql -u rasp_user -p
> CREATE DATABASE `rasp_db` CHARACTER SET utf8;
> exit
- The specifications of user and database are according to what we've set in settings.py. They are specified in
DATABASES
variable.
- Make migrations:
python manage.py makemigrations
- Migrate:
python manage.py migrate
Run server:
python manage.py runserver 0.0.0.0:8000
- Remember to activate and deactivate the server. The commands used are respectively
source venv/bin/activate
anddeactivate
.
The server will be run on 127.0.0.1:8000
/register
: Signup.
/login
: Login.
/panel
: Go to root directory.
/admin
: Admin panel. Remember to create an admin with python manage.py createsuperuser
command first.