Welcome to PentestingLab project. We are working hard on this project with Django, MapBox and more.
Same documentation at https://djangomaps.rtfd.io
Clone it from git
git clone https://github.com/ConnorHack69/django-maps-scripting.git
cd django-maps-scripting
Make sure you run pip command and manage.py using an environment based on python==3.6.0. For example:
For using this especific environmet, you have to use this command:
conda env create -f environment.yaml
Or create a empty environment
conda create -n yourEnvName python==3.6.0
This creates and environment for our packages to be installed. We have to activate now that environment and start installing whatever we need. In our case, we have all at requirements.txt
activate yourEnvName
source activate yourEnvName
Now, our shell should change a bit and start by (yourEnvName) /your/working/directory.
At this moment we are working in the virtual environment that we want to work in. Start installing all the requirements:
pip install -r requirements.txt
sudo apt-get install gettext
Now we can start our server:
python manage.py runserver
Then in your favorite Web Browser: http://127.0.0.1:8000/
For starting the BBDD we have to migrate and create super user:
python manage.py migrate
python manage.py createsuperuser
For stating a new app, we have to type:
python manage.py start nameAppHere
Then, for implement that app, we have to add it in our settings.py on INSTALLED_APPS. Now, migrate this app changes:
python manage.py makemigrations nameAppHere
python manage.py migrate nameAppHere
Now, you can run the server and try your app inside the project.
If you want to translate to any other language or simply help us on translating it, there are 2 commands you have to know.
First of all, create a folder named 'locale' in your root directory of your proyect and then edit settings.py for adding this on the bottom:
# LOCALES
LOCALE_PATHS = [
os.path.join(BASE_DIR, 'locale'),
]
LANGUAGES = [
('es', 'Español'),
('en', 'English'),
]
I18N = True
{% load i18n %}
{% trans "This is a message" %}
Then we are going to create de translations for that. In this example im translating to Spanish (es), like this:
django-admin makemessages -l es
So now we have inside 'locale' directory some files. We need to edit po named one. Inside we can see some lines and we will see something like this referencing to your html template tag name created before. The first line is the key for the translation. If we change that, the html should not work. So only write into msgstr the translation:
#: core/templates/core/home.html:7
msgid "This is a message"
msgstr "Esto es un mensaje"
Save that file and then:
django-admin compilemessages
No we have created a new language and set some translations for a message
pip install sphinx sphinx-autobuild
mkdir docs
cd docs/
sphinx-quickstart
Now we have new documents into the created folder docs/. Start editing index.rst for example and then:
make html
We are working hard for uploading the next version. Wait for it