Assistance with Django Booking app

176 views
Skip to first unread message

Eric 247ERICPOINTCOM

unread,
Apr 8, 2021, 5:57:57 PM4/8/21
to Django users
Good day,

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, 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.

Ryan Nowakowski

unread,
Apr 8, 2021, 6:29:29 PM4/8/21
to Django users
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

Kasper Laudrup

unread,
Apr 8, 2021, 7:04:12 PM4/8/21
to django...@googlegroups.com
I was in pretty much the same situation as you. What I needed was a
simple way to make bookings for our family summerhouse. Nothing fancy,
just a way for one of us to book some dates and avoid having to write
mails back and forth.

To achieve that, I also thought it would be the most obvious to use an
already made system, but it really turned out that nothing did really
what I wanted, was outdated or had other issues I can't really remember.

In the end, I implemented it myself and it turned out to be fairly
trivial to do.

Feel free to have a look at:

https://github.com/laudrup/ebbamaala

Be aware that this is not documented and very much made for this
specific purpose and I really doubt I'll get around to generalize this,
so this repository is not just the booking system code.

It was a while ago I wrote it and back then I was even less experienced
in Django than I am now, so if you feel like it, I think implementing
something like that can be recommended as a good learning experience.

I think I started by creating a Booking model with a User, a start and
end date and then worked my way from there.

Feel free to ask any questions and I'll see if I can help. Also be aware
that I'm definitely not saying this is the best way to do it, but at
least it's one way and it works well enough for my purpose :-)

Good luck.

Kind regards,

Kasper Laudrup

OpenPGP_signature

Eric 247ERICPOINTCOM

unread,
Apr 21, 2021, 6:47:11 AM4/21/21
to Django users
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 | eri...@gmail.com  | Address: 29 Rochester Road, Observatory | Cape Town, South Africa | 7925
f


--
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...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/20210408222833.GO15054%40fattuba.com.

Eric 247ERICPOINTCOM

unread,
Apr 21, 2021, 6:53:04 AM4/21/21
to django...@googlegroups.com
Hi Kasper Laudrup,

Thanks for your response, I have tried this option on pycharm. I just would like to know which of the packages I would need to install for this to work. 
I checked that I dont have most of the packages installed.

Kind Regards


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

--
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...@googlegroups.com.

Kasper Laudrup

unread,
Apr 21, 2021, 7:22:49 AM4/21/21
to django...@googlegroups.com
On 21/04/2021 12.51, Eric 247ERICPOINTCOM wrote:
> Thanks for your response, I have tried this option on pycharm. I just
> would like to know which of the packages I would need to install for
> this to work. 
> I checked that I dont have most of the packages installed.
>

I'm not really sure what you're trying to do, but if you cloned this
project I mentioned, all package requirements are listed in the
requirements.txt file which is more or less standard for pip.

You can install them with:

# pip install -r requirements.txt

In a virtual environment.

Be aware that I mentioned this project of mine for inspiration. I've
never really intended it to be used by anyone else, but you're of course
free to do so, just don't expect much support from my side.

Anyway, good luck with your project.

Kind regards,

Kasper Laudrup

OpenPGP_signature

Ryan Nowakowski

unread,
Apr 21, 2021, 4:20:34 PM4/21/21
to django...@googlegroups.com
It looks like you're probably trying to run that Django booking app with a version of Django that it was never designed to run with. It looks like the author of Django booking didn't lock down the django version in requirements.txt

https://github.com/bitlabstudio/django-booking/blob/master/requirements.txt

However, based on the last commit message for requirements.txt, it looks like Django 1.9 was the last version used.

Since the author didn't lock down dependency versions you might have quite a challenging time finding versions of the dependencies that work properly.

David Nugent

unread,
Apr 22, 2021, 7:44:01 PM4/22/21
to django...@googlegroups.com
On Wed, Apr 21, 2021 at 8:46 PM Eric 247ERICPOINTCOM <eri...@gmail.com> wrote:
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
 ...

  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)
 

This is a pretty classic error caused by a mismatch between Django version and the app you are trying to run.

Check the docs to ensure you're running a supported version of Django - the python_2_unicode_compatible decorator has not been around since Python 2 support was dropped.

If the app has no other python 2 dependencies you may be able to get away with simply removing the decorator from models that use it (and the import statement for it as well) as it is no longer necessary.

Reply all
Reply to author
Forward
0 new messages