-
Create a virtual environment by using the following command:
- for windows
python -m venv env
- for mac
python3 -m venv env
- for windows
-
Next you need to activate the virtual environment as:
- for windows
env\Scripts\activate
- for mac
source env/bin/activate
- for windows
-
Clone the repository using the following command:
git clone https://github.com/tkarotra/CrimeReportingSystem.git
-
We now need to move into our project folder. Do this by running the following command:
cd CrimeReportingSystem
-
Now we need to install all the dependencies of the project. This can be done using the following command:
pip install -r requirements.txt
-
Next you need to run the following command to setup our database:
python manage.py makemigrations
or
python manage.py makemigrations app
-
Then we simply need to apply these migrations by running:
python manage.py migrate
-
Next we need to create a super user to acess the database and all its tables:
python manage.py createsuperuser
-
Now finally to run the development server as follows:
python manage.py runserver
NOTE : You can refer the below table for the shortcuts to all the commands that were used above and more.
Just remeber to run
pip install django-shortcuts
command to use the bellow shortcuts.
Original Command | Shortcut |
---|---|
python manage.py runserver |
django r |
python manage.py makemigrations |
django mm |
python manage.py migrate |
django m |
python manage.py createsuperuser |
django csu |
python manage.py collectstatic |
django c |
python manage.py shell |
django s |
python manage.py changepassword |
django cpw |