Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
How to check if foreign key exists?
Here I have a model called Staff which has OneToOne relation with django User model and ForeignKey relation to the Organization model.Here while deleting the organization I want to check if the organization exists in Staff model or not .If it exists in Staff model then i don't want to delete but if it doesn't exists in other table then only I want to delete. How can I do it ? I got this error with below code: Exception Type: TypeError Exception Value: argument of type 'bool' is not iterable models.py class Organization(models.Model): name = models.CharField(max_length=255, unique=True) slug = AutoSlugField(unique_with='id', populate_from='name') logo = models.FileField(upload_to='logo', blank=True, null=True) class Staff(models.Model): user = models.OneToOneField(get_user_model(), on_delete=models.CASCADE, related_name='staff') name = models.CharField(max_length=255, blank=True, null=True) organization = models.ForeignKey(Organization, on_delete=models.SET_NULL, blank=True, null=True, related_name='staff') views.py def delete_organization(request, pk): organization = get_object_or_404(Organization, pk=pk) if organization in organization.staff.all().exists(): messages.error(request,"Sorry can't be deleted.") return redirect('organization:view_organizations') # also tried # if organization in get_user_model().objects.filter(staff__organization=organizatin).exists(): elif request.method == 'POST' and 'delete_single' in request.POST: organization.delete() messages.success(request, '{} deleted.'.format(organization.name)) return redirect('organization:view_organizations') -
Dokerize my Django app with PostgreSQL, db start and close unexpectedly
I am new to Docker and I want to dockerise the Django app to run as a container. Followed as below. i have OSX 10.11.16 El Capitan with Docker Toolbox 19.03.01. Here is the Dockerfile FROM python:3 ENV PYTHONUNBUFFERED 1 RUN mkdir /code WORKDIR /code COPY requirements.txt /code/ RUN pip install -r requirements.txt COPY . /code/ Here is docker-compose.yml conf version: '3' networks: mynetwork: driver: bridge services: db: image: postgres ports: - "5432:5432" networks: - mynetwork environment: POSTGRES_USER: xxxxx POSTGRES_PASSWORD: xxxxx web: build: . networks: - mynetwork links: - db environment: SEQ_DB: cath_local SEQ_USER: xxxxx SEQ_PW: xxxxx PORT: 5432 DATABASE_URL: postgres://xxxxx:xxxxx@db:5432/cath_local command: python manage.py runserver 0.0.0.0:8000 volumes: - .:/code ports: - "8000:8000" depends_on: - db well atthis point i run i run: docker-compose up but my postgreSQL db seem to start and stop without Errors, if i inspect db log in docker i get: 2019-09-17 03:29:37.296 UTC [1] LOG: listening on IPv4 address "0.0.0.0", port 5432 2019-09-17 03:29:37.301 UTC [1] LOG: listening on IPv6 address "::", port 5432 2019-09-17 03:29:37.304 UTC [1] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432" 2019-09-17 03:29:37.617 UTC [21] LOG: database system was shut down at 2019-09-17 03:28:33 UTC 2019-09-17 03:29:37.795 UTC [1] LOG: database system is … -
Two of my custom user models cannot fail to login
I have created 3 custom user models. However only one user under the models Users() is able to login in into a sells dashboard that I have created. I want the two user namelly, Buyer() and Supplier() to be able to login to the dashboard but not to the admin area. The following is my code. Please help me see the error. # models.py # These are my three custom models from django.db import models from django.contrib.auth.models import AbstractUser, AbstractBaseUser, UserManager, BaseUserManager, PermissionsMixin from django.conf import settings # Superuser model class Users(AbstractUser): username = models.CharField(max_length=25, unique=True) email = models.EmailField(unique=True, null="True") objects = UserManager() USERNAME_FIELD = 'username' REQUIRED_FIELDS = ['email'] # Returns username def __str__(self): return self.username # Supplier user model class Supplier(AbstractBaseUser): sname = models.CharField(max_length=255, verbose_name='Supplier Name', unique=True) phone_number = models.CharField(max_length=255, verbose_name='Phone Number') email_address = models.CharField(max_length=255, verbose_name='Email Address', null=True) physical_address = models.CharField(max_length=255, verbose_name='Physical Address') description = models.TextField(max_length=255, verbose_name='Describe yourself') is_active = models.BooleanField(default=True) objects = Users() USERNAME_FIELD = 'sname' def __str__(self): return self.sname # This model save inventory of a supplier class Inventory(models.Model): pname = models.CharField(max_length=255, verbose_name='Product Name') quantity = models.PositiveIntegerField(verbose_name='Quantity (kgs)') measurement = models.CharField(max_length=255, verbose_name='Measurement') orginal_price = models.PositiveIntegerField(verbose_name='Original Price') commission = models.PositiveIntegerField(verbose_name='Commission') selling_price = models.PositiveIntegerField(verbose_name='Selling Price (MWK)') supplier = models.ForeignKey(Supplier, … -
django.core.exceptions.ImproperlyConfigured: Error loading psycopg2 module: DLL load failed: The specified module could not be found
After running any command on my project directory i got this: Traceback (most recent call last): File "C:\Python27\Lib\site-packages\django\db\backends\postgresql\base.py", line 21, in <module> import psycopg2 as Database File "C:\Python27\Lib\site-packages\psycopg2\__init__.py", line 50, in <module> from psycopg2._psycopg import ( # noqa ImportError: DLL load failed: The specified module could not be found. During handling of the above exception, another exception occurred: Traceback (most recent call last): File "manage.py", line 15, in <module> execute_from_command_line(sys.argv) File "C:\Python27\Lib\site-packages\django\core\management\__init__.py", line 364, in execute_from_command_line utility.execute() File "C:\Python27\Lib\site-packages\django\core\management\__init__.py", line 338, in execute django.setup() File "C:\Python27\Lib\site-packages\django\__init__.py", line 27, in setup apps.populate(settings.INSTALLED_APPS) File "C:\Python27\Lib\site-packages\django\apps\registry.py", line 108, in populate app_config.import_models() File "C:\Python27\Lib\site-packages\django\apps\config.py", line 202, in import_models self.models_module = import_module(models_module_name) File "C:\Users\Ga\AppData\Local\Programs\Python\Python37\lib\importlib\__init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 1006, in _gcd_import File "<frozen importlib._bootstrap>", line 983, in _find_and_load File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 677, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 728, in exec_module File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed File "C:\Python27\Lib\site-packages\django\contrib\auth\models.py", line 4, in <module> from django.contrib.auth.base_user import AbstractBaseUser, BaseUserManager File "C:\Python27\Lib\site-packages\django\contrib\auth\base_user.py", line 52, in <module> class AbstractBaseUser(models.Model): File "C:\Python27\Lib\site-packages\django\db\models\base.py", line 124, in __new__ new_class.add_to_class('_meta', Options(meta, app_label)) File "C:\Python27\Lib\site-packages\django\db\models\base.py", line 325, in add_to_class value.contribute_to_class(cls, name) File "C:\Python27\Lib\site-packages\django\db\models\options.py", line 214, in … -
how can i access url from django file using webmin/virtualmin?
I have hosting server with virtualmin panel.i uploaded a django project file inside public_html folder.But i can't access my website using domain.But i can access simple html page inside public_html folder.any help is appreciated. -
Add m2m relation in Django rest framework
I need to add multiple m2m relationship between two objects in Django rest framework class Theme(models.Model): slug = models.CharField(primary_key=True, unique=True, db_index=True) menu = models.ManyToManyField(Menu, related_name='themes') class Menu(models.Model): pass Serializer class MenuAdminSerializer(serializers.ModelSerializer): themes = serializers.SlugRelatedField(many=True, read_only=False, required=False, slug_field='slug', queryset=Theme.objects.all()) class Meta: model = Menu fields = ('themes',) def create(self, validated_data): themes = validated_data.pop('themes') menu.themes.set(*themes) I pass themes like this ["one", "another"] but the error im getting is 'Theme' object is not iterable -
Could I use graphQL in django project with react?How?
I have some React project which should be loaded by django. how could I do it? -
Django views error in importing custom python files
I am trying to import main1.py file in views.py of my django app. But unable to import it. Moreover location of my main file and sub-dependent file also lies at the view.py folder location. I have tried with following options 1 import main with this error is : No module found with name main 2 from .app_name import main using this error is : import * only allowed at module level folder structure is -
How to replace threads in Django to Celery worker
I know it's not best practice use threads in django project but I have a project that is using threads: threading.Thread(target=save_data, args=(dp, conv_handler)).start() I want to replace this code to celery - to run worker with function save_data(dispatcher, conversion) Inside save_data I have infinite loop and in this loop I save states of dispatcher and conversation to file on disk with pickle. I want to know may I use celery for such work? Does the worker can see changes of state in dispatcher and conversation? -
Django queryset : How to exclude objects with any related object satisfying a condition
I stumbled upon a weird behaviour of django querysets while making a difficult query and I'd like to know if somebody knew how to improve this query. Basically I have a model like this: class Product(models.Model): pass class Stock(models.Model): product_id = models.ForeignKey(Product) date = models.DateField() initial_stock = models.SmallIntegerField() num_ordered = models.SmallIntegerField() And I'd like to select all Product that are not available for any date (means that there are no stock object related to the product which have their initial_stock field greater than the num_ordered field). So at first, I did: Product.objects.exclude(stock__initial_stock__gt=F('stock__num_ordered')).distinct() but I checked and this query translates as: SELECT DISTINCT * FROM "product" LEFT OUTER JOIN "stock" ON ("product"."id" = "stock"."product_id") WHERE NOT ("product"."id" IN ( SELECT U1."product_id" AS Col1 FROM "product" U0 INNER JOIN "stock" U1 ON (U0."id" = U1."product_id") WHERE (U1."initial_stock" > (U1."num_ordered") AND U1."id" = ("stock"."id")) )) Which makes a left join on stocks and then filters out the lines where the initial_stock is greater than the num_ordered before sending me back the distinct lines as a result. So as you can see, it doesn't work when I have a stock object that is out of stock and another stock object that is not out … -
Publish to MQTT in django Serializer save() method
I have a really simple API that uses django with restframework that act as an endpoint for iot devices. iot Devices --HTTP POST--> REST API (django) Data is validated and saved. No need for any render or GET/PATCH/DELETE at all. The only thing is that I'm not saving to database but I'd like to push to MQTT channel (other process that listen for messages will save/postprocess) As I am not a django expert at all, My idea was to override the Serializer save() method that it actually does not save but publish. MODEL class Meas(models.Model): SENSOR_TYPES = [ ('temperature','temperature'), ('humidity','humidity') ] sensorType = models.CharField(max_length=100, default='UNKNOWN', choices = SENSOR_TYPES ) sensorId = models.CharField(max_length=100) homeId = models.CharField(max_length=100) roomId = models.CharField(max_length=150) hubId = models.CharField(max_length=100) value = models.CharField(max_length=100) last_seen = models.DateTimeField() elapsed = models.IntegerField() objects = MeasManager() SERIALIZER class MeasMQTTSerializer(serializers.ModelSerializer): client = RMQPublisher(ch_name=rmq_chname,routing_key=rmq_routingkey,host=rmq_host,user=rmq_user,password=rmq_pass,port=rmq_port) class Meta: model = Meas fields = '__all__' def save(self): logging.debug("Saving measurement") measurement = self.validated_data['sensorType'] mytags = { 'sensorId' : self.validated_data['sensorId'], 'roomId' : self.validated_data['roomId'], 'hubId' : self.validated_data['hubId'], 'homeId' : self.validated_data['homeId'], 'elapsed' : self.validated_data['elapsed'], 'last_seen' : self.validated_data['last_seen'] } for a, x in mytags.items(): mytags[a]=str(x) value = float(self.validated_data['value']) rmq_msg = mytags rmq_msg['value']=value rmq_msg['measurement'] = measurement MeasMQTTSerializer.client.pushObject(rmq_msg) logging.debug("Pushed to RMQ") and RMQPublisher use just … -
Delay in updating live status from text file in django
I want to update some live status through text file on django html template. Issue is sometimes delay comes very late, not sure if this is due to linux-server dependencies or something else. Also, what is recommended location to store live logs for reading purpose, currently I am using static directory in django server. function update() { var xmlhttp = new XMLHttpRequest(); xmlhttp.onreadystatechange = function () { document.getElementById("live_status").innerHTML = this.readyState; if (this.readyState == 4 && this.status == 200) { var myObj = JSON.parse(this.responseText); x = "{{ details.chip_name }}" + "</br>"; for ( i in myObj.users ){ for ( j in myObj.users[i].live_status ){ x += myObj.users[i].live_status[j] + "</br>"; } } document.getElementById("live_status").innerHTML = x; //document.getElementById("live_status").innerHTML = "Test"; } }; xmlhttp.open("GET", "{% static 'live_status.txt' %}", true); xmlhttp.send(); } update(); setInterval(update, 10000); -
Login system which search in database in django
I have my own model and and i want to make login system which check in that model rather than default user model . Can anybody help me with this . I have been stuck in this problem for long time. I searched alot but could not find any solution. -
How to make a view as a url in templates.? (Python 3.6, Django 2.2)
These are my code #urls urlpatterns += [ path('blog/', include('blog.urls', namespace='blog')), path('products/', include('products.urls', namespace='products')), ] This is app urls # urls app_name = 'products' urlpatterns = [ path('', ProductHomeView.as_view(), name='home'), path('details/', ProductView.as_view(), name='details'), ] This is my view #views class ProductHomeView(View): def get(self, request, *args, **kwargs): product_data = Product.objects.all() context = { 'product': product_data, } return render(request, 'product_home.html', context) class ProductView(View): def get(self, request, *args, **kwargs): product_data = Product.objects.all() context = { 'product': product_data, } return render(request, 'product.html', context) this is my template # template product_home.html {% for product in product %} <h1>{{ product.tittle }}</h1> <p>{{ product.short_description }}</p> <button type="button"><a href="{% url 'products.details' %}">Explore More</a></button><br> {% endfor %} This is the error Error django.urls.exceptions.NoReverseMatch: Reverse for 'products.details' not found. 'products.details' is not a valid view function or pattern name. How do I resolve this? -
IntegrityError at /create/ (1048, "Column 'laenge' cannot be null")
While submitting my form in Django I get an IntegrityError that I can't resolve. I found other solutions to this problem where it was sugested to set null=True and blank=True. However, I don't want this field to be null=True. I submitted the form with trailform-laenge = '44', and I also printed out the cleaned data in my view which gave me 44. The DEBUG mode shows me that internaly laenge is set to Null when storing it in the database. I already reset the database and migrated the model again, but the same error still appears. views.py def create_trail(request): if request.method == 'POST': trailform = TrailForm(request.POST, request.FILES, prefix="trailform") etappeformset = EtappeFormset(request.POST, prefix="etappeformset") bildformset = BildFormset(request.POST, prefix="bildformset") if trailform.is_valid() and etappeformset.is_valid() and bildformset.is_valid(): trail = trailform.save(commit=False) trail.autor = request.user trail.save() trail = get_object_or_404(Trail, pk=trail.id) models.py class Trail(models.Model): laenge = models.DecimalField( #in Kilommeter max_digits=7, decimal_places=2, verbose_name='Streckenlänge', help_text='in Kilometern', validators=[MinValueValidator(0)] ) IntegrityError at /create/ (1048, "Column 'laenge' cannot be null") Request Method: POST Request URL: Django Version: 2.2 Exception Type: IntegrityError Exception Value: (1048, "Column 'laenge' cannot be null") Exception Location: /home/name/.local/lib/python3.6/site-packages/django/db/backends/mysql/base.py in execute, line 76 Python Executable: /usr/bin/python Python Version: 3.6.7 Python Path: ['/home/t_puetz16/django_code/stupro', '/usr/lib/python36.zip', '/usr/lib/python3.6', '/usr/lib/python3.6/lib-dynload', '/home/t_puetz16/.local/lib/python3.6/site-packages', '/usr/local/lib/python3.6/dist-packages', '/usr/lib/python3/dist-packages'] Server time: … -
AUTH_USER_MODEL refers to model 'auth.User' that has not been installed , how to provide default user logged in value in models.py
im trying to provide default value from models.py class OrderManager(models.Manager): def staff_rest(self ,request): return self.staff = request.user class Order(models.Model): staff = models.CharField(max_length=20 , default='') id = models.AutoField(primary_key = True) pass objects = OrderManager() but i got this error AUTH_USER_MODEL refers to model 'auth.User' that has not been installed i also tried to override same() method def save(self , *args,**kwargs): self.staff = request.user super(Order,self).save() error :name 'request' is not defined thanks for helping -
"NoReverseMatch" issue in Django
NoReverseMatch at /en-us/schools/1/classroom/1/update/ Reverse for 'index' with arguments '('',)' not found. 1 pattern(s) tried: ['en-us/schools/(?P\d+)/index/$'] urls.py url(r'^(?P\d+)/classroom/(?P\d+)/update/$', views.ClassroomUpdateView.as_view(), name='classroom_update') -
Unable to migrate with django_mssql_backend to outside host
I'm trying to migrate my django project and use SQL Server 2012 as database backend. For connection, i'm using django-mssql-backend. But, something wrong happen when trying to migrate. File "C:\ProgramData\Anaconda3\lib\site-packages\django\db\backends\utils.py", line 76, in _execute_with_wrappers return executor(sql, params, many, context) File "C:\ProgramData\Anaconda3\lib\site-packages\django\db\backends\utils.py", line 84, in _execute return self.cursor.execute(sql, params) File "C:\ProgramData\Anaconda3\lib\site-packages\django\db\utils.py", line 89, in __exit__ raise dj_exc_value.with_traceback(traceback) from exc_value File "C:\ProgramData\Anaconda3\lib\site-packages\django\db\backends\utils.py", line 82, in _execute return self.cursor.execute(sql) File "C:\ProgramData\Anaconda3\lib\site-packages\django_mssql_backend-2.2.0-py3.7.egg\sql_server\pyodbc\base.py", line 536, in execute django.db.utils.Error: ('21000', '[21000] [Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression. (512) (SQLExecDirectW); [21000] [Microsoft][ODBC Driver 13 for SQL Server][SQL Server]The statement has been terminated. (3621)') And here my code for define database in settings.py: DATABASES = { 'default': { 'ENGINE': 'sql_server.pyodbc', 'NAME': 'djangodb', 'USER': 'user', 'PASSWORD': 'pass', 'HOST': '172.30.55.7', 'PORT': '', 'OPTIONS': { 'driver': 'ODBC Driver 13 for SQL Server', }, } } As info, database host to another server and I ain't use model. But, if I change database host into 'localhost' (of course, I created same database in my local computer), migration process success. Thanks for help. -
How can I create objects in a for-loop in python?
I'm trying to create some objects in database through a for loop in python, but when I try, it only inserts last one. This is the code I have, where 'langssplit' is a list, the result of spliting a string like '2-3' (the pks of the Language rows in the table). I need to create and insert an object into the database for each element on the list, but it only saves the last one. The newprofile is an object I have already created. langsparam = request.GET.get('langs', '') langssplit = langsparam.split('-') for lan in langssplit: lang = Languages.objects.filter(pk=lan).first() newprofilelan = ProfilesLanguages(profile=newprofile, language=lang) newprofilelan.save() What am I doing wrong? Thanks for any help! -
Validation of custom widgets
How should validation errors be propagated for custom widgets where the widget input itself may be incoherent? Case in point, I'm creating a custom date input widget for a Date field that allows the user to select the date according to the Japanese Imperial calendar. This requires an era dropdown and a year input, and it's perfectly possible to select an era–year combination that is in itself invalid. The widget converts this input to/from a Python date object using the MultiWidget.value_from_datadict/MultiWidget.decompress methods: def value_from_datadict(self, data, files, name): era, imperial_year, month, day = [widget.value_from_datadict(data, files, f'{name}_{i}') for i, widget in enumerate(self.widgets)] try: return date(self._j2w.convert(f'{era}{imperial_year}年'), int(month), int(day)) except ValueError: # selected era/year combination was invalid return '' All I can do in this method is catch any ValueError and return an empty value instead, which means the field's validator complains about missing data, not about an incorrect value. If I simply raise the ValueError or a ValidationError, it's causing an uncaught exception error. Where and how should this kind of validation happen? I'd like the keep the abstraction of the Japanese picker purely inside the UI layer, and keep the backing field a simple Date field. -
django celery not executing tasks.py in digitalocean server
I used Celery in my django project for schedule tasks, it was kinda perfect in local server, I upload this update to my digitalocean server, and after 3 days of searching and fixing issues I couldn't understand that pinch of mistakes I did ! , here is my project structure ├── app │ ├── __init__.py │ ├── admin.py │ ├── urls.py │ ├── models.py │ ├── apps.py │ └── views.py ├── manage.py ├── corsa │ ├── __init__.py │ ├── celery.py │ ├── settings.py │ ├── urls.py │ └── wsgi.py ├── requirements.txt └── templates ├── base.html ├── other tasks.py : @shared_task def just_testing(): print(' test log ') @shared_task def tasks_to_do_daily(): # some stuff to do daily @shared_task def tasks_to_do_weekly(): # some stuff to do weekly celery.py : os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'corsa.settings') app = Celery('corsa') app.config_from_object('django.conf:settings', namespace='CELERY') app.autodiscover_tasks() app.conf.beat_schedule = { 'add-contrab1': { 'task': 'app.tasks.just_testing', 'schedule': 6.0, }, 'add-contrab2': { 'task': 'app.tasks.tasks_to_do_daily', 'schedule': crontab(minute='26', hour='09'), }, 'add-contrab3': { 'task': 'app.tasks.tasks_to_do_weekly', 'schedule': crontab(minute='00', hour='00', day_of_week='sat,tue'), }, } app.conf.CELERY_TIMEZONE = 'Asia/Hong_Kong' settings.py : CELERY_BROKER_URL = 'amqp://localhost' Ok, now issues part .. For local I tried these commends celery -A corsa worker -l info , celery -A corsa beat -l info , celery worker -A corsa --loglevel=INFO … -
Style guide: how to not ot get int o a mess in a big project
Django==2.2.5 In the examples below two custom filters and two auxiliary functions. It is a fake example, not a real code. Two problems with this code: 1. When a project becomes big I forget what aux functions I have already written. Not to mention team programming. What is the solution here? To organize a separate module for functions that can be imported? And sort them alphabetically? 2. Some functions from here may be reused outside this package, and some may not. Say, the combine function seems to be reusable, while "get_salted_str" is definitely for this module only. I think that it is better to distinguish between functions that may be imported and those that may not. Is it better to use underline symbol to mark unimported functions? Like this: _get_salted_str. This may ease the first problem a bit. 3. Does Django style guide or any other pythonic style guide mention solutions to the two above mentioned problems? def combine(str1, str2): return "{}_{}".format(str1, str2) def get_salted_str(str): SALT = "slkdjghslkdjfghsldfghaaasd" return combine(str, SALT) @register.filter def get_salted_string(str): return combine(str, get_salted_str(str)) @register.filter def get_salted_peppered_string(str): salted_str = get_salted_str(str) PEPPER = "1234128712908369735619346" return "{}_{}".format(PEPPER, salted_str) -
Filter data based on current date + 365 days in Django Rest framework
I am trying to build a web app. Part of the requirement is when the user clicks on a time interval like "1 year", he can view all the upcoming movies in one year. When the user clicks on "1 year" it should trigger a filter which displays movies from today till next year. How is it possible in django ? I want to make a filter similar to this logic - class sales_plot(APIView): def post(self, request, *args, **kwargs): interval = json.loads(request.body).get('interval') queryset = model_name.objects.filter(date_of_relase= current_date + interval) serialize = serializer_name(queryset, many=True) return Response(serialize.data, status=status.HTTP_200_OK) How can I do that ? -
How to deal with standard Error object on frontend?
I have a frontend app with many API requests, but it's a pain to work with error responses. Sometimes I need to go through many objects like: error.response.data.email and sometimes it is error.response.data.address.province[0]. I can't predict all of the errors, and writing manual "parsers" looks like a dirty extra solution to me: const errorsObject = err.response.data let errors = '' Object.keys(errorsObject).map(key => { if (key === 'address') { Object.keys(errorsObject.address).map( key => (errors += `${key} : ${errorsObject.address[key]}\n`) ) } else { errors += `${key} : ${errorsObject[key]}\n` } return undefined }) yield toast.error(errors) Also it still doesn't cover everything. Is there any frontend parsers for that? If not, our backend is Python(Django), maybe there is a package for backend side? Ideally I'd want to see a flat array of objects {title, message}. -
How to setup vue template with django project
I have downloaded vuejs template,I want to setup with django project(my django side is already up and running) I don't want to spend much time reading the structure of vuejs and its components by now. Am wondering is there any easy way to setup like vue CLI or any. Please help me any easy way to integrate!!