jypsi / cabs Goto Github PK
View Code? Open in Web Editor NEWAn open source web framework to manage cab services
License: GNU General Public License v3.0
An open source web framework to manage cab services
License: GNU General Public License v3.0
Using selenium script or automation script,
attacker / hacker can fill the cab booking form and send unwanted cab booking requests.
We should use CAPTCHA to prevent such spamming attack.
/admin/finance/payment/
/admin/opencabs/accounts
/admin/opencabs/bookings
Example from current implementation: https://github.com/rtnpro/opencabs/blob/master/opencabs/admin.py#L25-L87
Upstream docs:
https://django-import-export.readthedocs.io/en/latest/
Is anyone running a hosted version of jypsi/cabs? Thanks!
PR coming soon :)
It should be something like below:
class SMS:
def send(number, message):
...
Users should be able to subclass the above class and integrate with their own SMS provider. They can point to use the custom SMS class in settings.py:
SMS_BACKEND = 'path.to.sms.class'
I am keen to try out this project but I am new to docker.
The first 3 commands ran as expect
sudo dnf install docker docker-compose -y
sudo systemctl enable docker; sudo systemctl start docker
sudo chcon -Rt svirt_sandbox_file_t $(pwd)
I didn't realise the forth command sudo docker-compose up -d
required me to download the source and run the command from within the root directory.
The final command
# Load sample data
sudo docker-compose run web python3 manage.py loaddata data/opencabs.json
Starting opencabsmaster_db_1 ...
Starting opencabsmaster_db_1 ... done
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/django/db/backends/base/base.py", line 199, in ensure_connection
self.connect()
File "/usr/local/lib/python3.6/site-packages/django/db/backends/base/base.py", line 171, in connect
self.connection = self.get_new_connection(conn_params)
File "/usr/local/lib/python3.6/site-packages/django/db/backends/postgresql/base.py", line 176, in get_new_connection
connection = Database.connect(**conn_params)
File "/usr/local/lib64/python3.6/site-packages/psycopg2/__init__.py", line 130, in connect
conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
psycopg2.OperationalError: could not translate host name "db" to address: Name or service not known
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "manage.py", line 22, in <module>
execute_from_command_line(sys.argv)
File "/usr/local/lib/python3.6/site-packages/django/core/management/__init__.py", line 367, in execute_from_command_line
utility.execute()
File "/usr/local/lib/python3.6/site-packages/django/core/management/__init__.py", line 359, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/local/lib/python3.6/site-packages/django/core/management/base.py", line 294, in run_from_argv
self.execute(*args, **cmd_options)
File "/usr/local/lib/python3.6/site-packages/django/core/management/base.py", line 345, in execute
output = self.handle(*args, **options)
File "/usr/local/lib/python3.6/site-packages/django/core/management/commands/loaddata.py", line 63, in handle
with transaction.atomic(using=self.using):
File "/usr/local/lib/python3.6/site-packages/django/db/transaction.py", line 158, in __enter__
if not connection.get_autocommit():
File "/usr/local/lib/python3.6/site-packages/django/db/backends/base/base.py", line 365, in get_autocommit
self.ensure_connection()
File "/usr/local/lib/python3.6/site-packages/django/db/backends/base/base.py", line 199, in ensure_connection
self.connect()
File "/usr/local/lib/python3.6/site-packages/django/db/utils.py", line 94, in __exit__
six.reraise(dj_exc_type, dj_exc_value, traceback)
File "/usr/local/lib/python3.6/site-packages/django/utils/six.py", line 685, in reraise
raise value.with_traceback(tb)
File "/usr/local/lib/python3.6/site-packages/django/db/backends/base/base.py", line 199, in ensure_connection
self.connect()
File "/usr/local/lib/python3.6/site-packages/django/db/backends/base/base.py", line 171, in connect
self.connection = self.get_new_connection(conn_params)
File "/usr/local/lib/python3.6/site-packages/django/db/backends/postgresql/base.py", line 176, in get_new_connection
connection = Database.connect(**conn_params)
File "/usr/local/lib64/python3.6/site-packages/psycopg2/__init__.py", line 130, in connect
conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
django.db.utils.OperationalError: could not translate host name "db" to address: Name or service not known
docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
8d574bbec457 opencabsmaster_web "python3 manage.py..." 15 minutes ago Restarting (1) 59 seconds ago opencabsmaster_web_run_1
094a363b875a opencabsmaster_web "bash -c 'python3 ..." 16 minutes ago Restarting (1) About a minute ago opencabsmaster_web_1
sudo docker-compose ps
Name Command State Ports
------------------------------------------------------------------------------
opencabsmaster_db_1 docker-entrypoint.sh postgres Exit 1
opencabsmaster_web_1 bash -c python3 manage.py ... Restarting
opencabsmaster_web_run_1 python3 manage.py loaddata ... Restarting
I contacted rtnpro via email and he advised me to try
sudo docker-compose pull db
Pulling db (postgres:latest)...
Trying to pull repository docker.io/library/postgres ...
sha256:d99f15cb8d0f47f0a66274afe30102b5bb7a95464d1e25acb66ccf7bd7bd8479: Pulling from docker.io/library/postgres
Digest: sha256:d99f15cb8d0f47f0a66274afe30102b5bb7a95464d1e25acb66ccf7bd7bd8479
Status: Image is up to date for docker.io/postgres:latest
Hope this helps, would love to get this running. thanks you.
To fix:
This will allow the admins to add image for a vehicle category, which can then be displayed in the vehicles search page.
Adding a queryset for source
and destination
fields which sorts the Place
queryset by name
should be good enough.
Ref: https://docs.djangoproject.com/en/2.2/ref/forms/fields/#fields-which-handle-relationships
Adding something like below here: https://github.com/jypsi/cabs/blob/master/opencabs/forms/booking.py#L27 should do the trick.
self.fields['source'].queryset = self.fields['source'].querset.order_by('name')
self.fields['destination'].queryset = self.fields['destination'].querset.order_by('name')
Use jQuery chosen, https://harvesthq.github.io/chosen/ to implement this.
A new use case came up in case of bookings done by agents at a travel desk. The accountant needs to verify the payments received by the agents for audit. Till the time the money makes to the records of the accountant, the payment transaction is not verified.
We'll need to add new fields in finance/payments
model so that an accountant user can mark the payments as verified once the accountant collects the money from the desk agents.
Export data in csv format from bookings table.
https://django-storages.readthedocs.io/
We can test it locally by adding a minio (https://hub.docker.com/r/minio/minio/) service in our local docker-compse setup.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.