The frontend for the lost children project. This project uses django.
First, make sure you have Python installed. Python 3 is recommended.
This project uses pipenv to manage packages and versions. Refer to their installation section to know how to install it.
-
Create
.env
file in the project root with the required environment variables. See.env.example
for list of environment variables. -
Activate the virtual environment using
pipenv shell
-
Install all packages:
pipenv install
- Activate virtual environment:
pipenv shell
- Install all pacakges for this project:
pipenv install
- install a package:
# Install a normal dependancy:
pipenv install mypackage
# Install a dev dependency:
pipenv install mypackage --dev
- Create requirements.txt if needed:
pipenv lock -r > requirements.txt
Don't forget to activate the virtual environment first. For full list of commands, refer to manage.py documentation
- Run the development server:
python manage.py runserver
- Create a new app (module):
python manage.py startapp module_name
- Create a migration:
python manage.py makemigrations module_name
- Migrate database:
python manage.py migrate
- Run cron jobs:
python manage.py runcrons
- Create a superuser for admin interface:
python manage.py createsuperuser
- Check app for errors:
python manage.py check
- To lint your code:
find . -type f -name "*.py" -not -path "**/migrations/*" | xargs pylint
Most of the problems you might face will mostly be because you are not using the right virual environment or that you didn't install the required packages. Make sure your IDE using the correct interpretter from your venv. You can get the path to the venv interpretter using:
pipenv --py
This project uses django-cron
to setup cron jobs. For more info about how to setup a cron job and what is the available commands, refer to their installation doc
- Add tests
- Validate request expected attributes