Skip to content
Advertisement

Tag: django

How start celery worker in Django project

I have a Django project with the directory structure mentioned below. I am trying to use Celery for running tasks in the background. I have facing some trouble while running the worker. Whenever I issue the following command, I get an error. Command From the projectdirectory where manage.py resides ModuleNotFoundError: No module named ‘tasks’ From the projectdirectory where celery.py resides

Convert date object in normal format

When I am using a Python object, I get: This is not the format I need. We need to convert to this data format: How can I convert this in Python/Django? Example: It’s working fine, but how can I pass 2018-05-18 10:05:06 as database but database giving? It’s giving 2018-05-18 08:38:58+00:00. How can I check date as per 2018-05-18 08:38:58?

How to auto generate slug from my Album model in django 2.0.4

I have an Album field with a list of Songs I would like to know how to generate slugs from the album title. I am following a tutorial which is using django 1.8 which uses regular expressions to implement this task. But from looking through the documentation they have introduced a more simpler approach (”). So can you help explain

Django test error: Column does not exist

Postgresql, Django 2.0, Python 3.6.4 After running a migration that changed the name of a field desktop_pay to simply pay, I’m getting an error when running manage.py test saying the column pay does not exist. Here’s the migration: Here’s the error: If I start a psql prompt, though, I can clearly see that the column does exist, at least in

How to list applied migrations from command line?

I had run makemigrations and after that migrate to apply the migration How to find out models in boards from command line? Answer You’ll need to use some undocumented APIs for this, but here’s one way: After this, loader.disk_migrations will be a dictionary whose keys are (app_name, migration_name) tuples, and whose values are the Migration objects. So iterating loader.disk_migrations.keys() will

Django 2.0 – Reverse for ‘password_change_done’ not found. ‘password_change_done’ is not a valid view function or pattern name

I’m having this error message after trying to change my app’s password. Do you have any idea of what’s causing this route to fail? Actually, it is changing the password but it isn’t rendering the success template “password_change_done.html”. Thanks! app/urls.py ERROR MESSAGE app/templates/registration/password_change_form.html app/templates/registration/password_change_done.html Thanks for your help! Answer I think the problem here is, as Tobit hints, is that

Advertisement