Wednesday, April 21, 2021

Re: Assistance with Django Booking app

Hi Ryan,

Am trying to use booking on a marketing system that is developing for different kinds of businesses like property where someone would be able to book an appointment for a viewing or a service like a Mobile car wash where someone would be able to book a car washer for a specific time. But on the same system so it would be dynamic depending on the service someone would like to book for or a product someone would like to schedule to buy like shoes or anything.

I followed the steps as indicated in the README file and installed Django-booking successfully, but there are a couple of errors I get with this app when I run the server with: python manage.py runserver.

This is what I get.

(envirn) C:\Users\Eric\Desktop\Shop>python manage.py runserver
Watching for file changes with StatReloader
Exception in thread django-main-thread:
Traceback (most recent call last):
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.496.0_x64__qbz5n2kfra8p0\lib\threading.py", line 954, in _bootstrap_inner
    self.run()
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.496.0_x64__qbz5n2kfra8p0\lib\threading.py", line 892, in run
    self._target(*self._args, **self._kwargs)
  File "C:\Users\Eric\Desktop\Shop\envirn\lib\site-packages\django\utils\autoreload.py", line 53, in wrapper
    fn(*args, **kwargs)
  File "C:\Users\Eric\Desktop\Shop\envirn\lib\site-packages\django\core\management\commands\runserver.py", line 110, in inner_run
    autoreload.raise_last_exception()
  File "C:\Users\Eric\Desktop\Shop\envirn\lib\site-packages\django\utils\autoreload.py", line 76, in raise_last_exception
    raise _exception[1]
  File "C:\Users\Eric\Desktop\Shop\envirn\lib\site-packages\django\core\management\__init__.py", line 357, in execute
    autoreload.check_errors(django.setup)()
  File "C:\Users\Eric\Desktop\Shop\envirn\lib\site-packages\django\utils\autoreload.py", line 53, in wrapper
    fn(*args, **kwargs)
  File "C:\Users\Eric\Desktop\Shop\envirn\lib\site-packages\django\__init__.py", line 24, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "C:\Users\Eric\Desktop\Shop\envirn\lib\site-packages\django\apps\registry.py", line 114, in populate
    app_config.import_models()
  File "C:\Users\Eric\Desktop\Shop\envirn\lib\site-packages\django\apps\config.py", line 211, in import_models
    self.models_module = import_module(models_module_name)
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.496.0_x64__qbz5n2kfra8p0\lib\importlib\__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 790, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "C:\Users\Eric\Desktop\Shop\envirn\lib\site-packages\booking\models.py", line 9, in <module>
    from django_libs.models_mixins import TranslationModelMixin
  File "C:\Users\Eric\Desktop\Shop\envirn\lib\site-packages\django_libs\models_mixins.py", line 5, in <module>
    from django.utils.encoding import python_2_unicode_compatible
ImportError: cannot import name 'python_2_unicode_compatible' from 'django.utils.encoding' (C:\Users\Eric\Desktop\Shop\envirn\lib\site-packages\django\utils\encodi
ng.py)

I have installed six
I have also installed django.utils, but I just can't seem to run the server anymore. Is there a way I can manage to run the booking app without using django.utils

Kind Regards


Eric Bawakuno | Computer Engineer | +27795639700| +27 815152254 | ericbaw@gmail.com  | Address: 29 Rochester Road, Observatory | Cape Town, South Africa | 7925
f


On Fri, Apr 9, 2021 at 12:29 AM Ryan Nowakowski <tubaman@fattuba.com> wrote:
On Thu, Apr 08, 2021 at 07:19:53AM -0700, Eric 247ERICPOINTCOM wrote:
> I am new to Python and Django, I just discovered that I can use Django to
> easily implement a project that am working on.
>
> I would like to get some assistance with implementing a booking app into my
> project.
>
> I came across Django-Booking but I dont know how exactly it works,

Yup, you're in the position of wanting to leverage as much existing code
as possible, but being inexperienced enough to not know how to evaluate
the quality or usefulness of that existing code.  I feel for you for sure.
A couple of questions to hopefully help clarify things:

1. What kinds of things are you trying to book?  Rooms at a hotel,
tables at a restaurant, chairs at a barbershop?  It looks like
django-booking is set up to handle multiple people attached to a single
booking[a].  Is this something you need?

2. django-booking hasn't been updated in 5 years[b].  It looks like the
last update was for Django 1.9.  The latest Django is 3.2.  Is that a
concern for you?

3. It it weird that django-booking includes an error logging table[c]?
Django already has standard ways of reporting errors[d].  Why invent a
new one?

[a] https://github.com/bitlabstudio/django-booking/blob/master/booking/models.py#L336
[b] https://github.com/bitlabstudio/django-booking/commits/master
[c] https://github.com/bitlabstudio/django-booking#error-logging
[d] https://docs.djangoproject.com/en/3.1/howto/error-reporting/

> do I need to create an app for booking like a new app into my project
> or do I need to use it as a built in package only. Your help will be
> highly appreciated.

You might be able to use the django-booking app as is by just following
the directions in the README[e].  There might be no need to create your
own app.

[e] https://github.com/bitlabstudio/django-booking

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/20210408222833.GO15054%40fattuba.com.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAFgqToUTw%3DpgeEMCmvkqy4jEmAnyfpj-HE6or7MnpQkY4tcFGg%40mail.gmail.com.

No comments:

Post a Comment