Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
How can i auth_group for user in django
i have a question about django framework that how can i write User Model for each user registed have their function. Like: grab have 2 signals are driver and customer. How can i do that or anyone have example code about that. Thank for supported me!! -
Contained by with default ID as a parameter doesn't work
I want to check if the id of a page of exercises is inside of an array for solvedExercises. I thought this might be easy to do with a contained_by, but it doesn't work. I've tried this line (but I also want to randomise the questions) randomQuestions = Exercises.objects.filter(id__contained_by=(req.user.profile.exercitiiProvocari).order_by("?") but it doesn't work. I'm getting this error: Unsupported lookup 'contained_by' for AutoField or join on the field not permitted, perhaps you meant contains or icontains? I suppose this error comes from the fact that ID is an auto-generated field by django, but I have no idea how to fix it. views.py from django.shortcuts import render from exercitii.models import Exercises # Create your views here. def index(req): return render(req, "../templates/pagini/provocari.html") def provocari(req): randomQuestions = Exercises.objects.filter(id__contained_by=(req.user.profile.exercitiiProvocari).order_by("?") print(randomQuestions) return render(req, "../templates/pagini/provocare.html") Exercitii model from django.db import models from django.contrib.postgres.fields import ArrayField from lectii.models import Lectie # Create your models here. class Exercises(models.Model): idLectie = models.ForeignKey(Lectie, on_delete=models.DO_NOTHING, blank=True, null=True) intrebare = models.CharField(max_length = 300) variante = ArrayField(models.CharField(max_length=300), null=True) variantaCorecta = models.CharField(max_length = 1) def __str__(self): return self.intrebare So what I'm actually doing is to try to make the difference of an array of all exercises with one with the IDs of already solved exercises, … -
Could not find a version that satisfies the requirement ItsDangerous==1.0.0. Django, Pythonanywhere
When I try to deploy my application to pythonanywhere, the following error it is returned. Could not find a version that satisfies the requirement ItsDangerous==1.0.0 How can I solve it? I tried to change the versions to a higher one or add other packages (as per the internet tips), but to no avail. Any help will be appreciated. My requirements file. absl-py==0.7.1 aiourllib==0.1.3 appdirs==1.4.3 asn1crypto==0.24.0 astor==0.7.1 beautifulsoup4==4.6.3 bleach==3.0.2 boto==2.49.0 boto3==1.9.103 botocore==1.12.103 bs4==0.0.1 certifi==2018.10.15 cffi==1.12.2 chardet==3.0.4 civis==1.9.0 civis-jupyter-extensions==0.1.3 civis-jupyter-notebook==0.4.2 click==6.7 cloudpickle==0.6.1 colorama==0.4.0 confusable-homoglyphs==3.2.0 crypto==1.4.1 cryptography==2.6.1 cssselect==1.0.3 cycler==0.10.0 decorator==4.3.0 defusedxml==0.5.0 Django==2.0 django-bootstrap3==11.0.0 django-bower==5.2.0 django-ckeditor==5.6.1 django-cors-headers==2.4.0 django-crispy-forms==1.7.2 django-debug-toolbar==1.9.1 django-filter==2.0.0 django-filters==0.2.1 django-js-asset==1.2.2 django-multiselectfield==0.1.8 django-registration==2.4.1 django-scheduler==0.8.7 django-storages==1.7.1 django-taggit==0.23.0 django-tinymce==2.8.0 django-widget-tweaks==1.4.3 djangorestframework==3.9.0 docutils==0.14 entrypoints==0.2.3 fake-useragent==0.1.11 Flask==1.0.2 gast==0.2.2 gitdb2==2.0.5 GitPython==2.1.11 grpcio==1.19.0 h5py==2.9.0 httplib2==0.11.3 icalendar==4.0.3 idna==2.7 ipykernel==5.1.0 ipython==6.2.1 ipython-genutils==0.2.0 ipywidgets==7.4.2 ItsDangerous==1.0.0 jedi==0.13.1 Jinja2==2.10 jmespath==0.9.4 joblib==0.11 jsonref==0.1 jsonschema==2.6.0 jupyter==1.0.0 jupyter-client==5.2.3 jupyter-console==6.0.0 jupyter-core==4.4.0 Keras-Applications==1.0.7 Keras-Preprocessing==1.0.9 kiwisolver==1.0.1 lxml==4.2.5 Markdown==3.0.1 MarkupSafe==1.0 matplotlib==3.0.3 mistune==0.8.4 Naked==0.1.31 nbconvert==5.4.0 nbformat==4.4.0 notebook==5.7.0 numpy==1.15.2 pandas==0.23.4 pandocfilters==1.4.2 parse==1.9.0 parso==0.3.1 pickleshare==0.7.5 Pillow==5.3.0 prometheus-client==0.4.2 prompt-toolkit==1.0.15 protobuf==3.7.0 psycopg2==2.7.5 pubnub==4.1.2 PyAutoGUI==0.9.41 pybase62==0.4.0 pycparser==2.19 pycrypto==2.6.1 pycryptodome==3.8.0 pycryptodomex==3.6.6 pyee==5.0.0 PyGetWindow==0.0.3 Pygments==2.2.0 PyMsgBox==1.0.6 pyparsing==2.2.2 pyppeteer==0.0.25 pyquery==1.4.0 PyRect==0.1.4 PyScreeze==0.1.19 python-dateutil==2.7.3 python-decouple==3.1 PyTweening==1.0.3 pytz==2018.5 pywinpty==0.5.4 PyYAML==3.13 pyzmq==17.1.2 qtconsole==4.4.2 requests==2.20.0 requests-html==0.9.0 s3transfer==0.2.0 scipy==1.1.0 seaborn==0.9.0 Send2Trash==1.5.0 shellescape==3.4.1 simplegeneric==0.8.1 six==1.11.0 smmap2==2.0.5 sqlparse==0.2.4 tensorboard==1.12.2 tensorflow==1.12.0 termcolor==1.1.0 terminado==0.8.1 testpath==0.4.2 tornado==5.1.1 tqdm==4.27.0 traitlets==4.3.2 Unidecode==1.0.23 … -
How easy is it to change from Carrot to Celery in a Django project?
For a Django webapp I'm in need of a task queue. I'm considering django-carrot and Celery. Since the application is still relatively simple I'm leaning towards django-carrot for now. However, my app might outgrow the capabilities of django-carrot as it evolves. How easy would it be to change to Celery after adopting django-carrot? Does anyone have experience with this? -
Group Django queryset by value with pandas
I'm working on a script to group the Django queryset by a field. PersonLog model: camera = models.ForeignKey(Camera, on_delete=models.CASCADE, null=True, blank=True) # Person - Will have values for member, and null for non member log person = models.ForeignKey(Person, on_delete=models.CASCADE, null=True, blank=True) created_user = models.ForeignKey(User, on_delete=models.SET_NULL, null=True) entry_time = models.DateTimeField(blank=True, null=True) exit_time = models.DateTimeField(blank=True, null=True) I want to group the logs by created_user and camera for total members and non members. I'm new to pandas just grouped with the following code, import pandas log_qs = EntryExitLog.objects.filter(Q(entry_time__range=(from_date, to_date)) | \ Q(exit_time__range=(from_date, to_date)), camera__wandrecorder__in=wr_arr) log_data_dict = {} for i, log in enumerate(log_qs): log_data_dict[str(i)] = {} log_data_dict[str(i)]['company'] = log.camera.user.company.name if log.camera.user.company else None log_data_dict[str(i)]['name'] = log.created_user.name log_data_dict[str(i)]['email_id'] = log.created_user.email_id log_data_dict[str(i)]['camera_name'] = log.camera.nick_name if log.camera.nick_name else None log_data_dict[str(i)]['camera_id'] = log.camera.camera_id log_data_dict[str(i)]['person_id'] = log.person.id if log.person else None data_frame = pandas.DataFrame.from_dict(log_data_dict, orient='index') print(data_frame.groupby('email_id').groups)) just wondering to get the desired output, { 'user_email1': { 'camera_name1': {'memers': 10, 'non_members': 3, 'total_count': 13}, 'camera_name2': {'members': 100, 'non_members': 20, 'total_count': 120} }, 'user_email2': { 'camera_name1': {'memers': 150, 'non_members': 30, 'total_count': 180}, 'camera_name2': {'members': 190, 'non_members': 10, 'total_count': 200} } } -
How to update another model field from updateview
How can I use the current value of a field in update view to update another field? I have a model employee. It has a field day_absent and amount_absent which shows the total deduction amount based on how many day_absent. In update view the can set the day_absent. When I can back to DetailView, say the day_absent is 1. but the deduction is still 0. I understand that this is because prior to save(), day_absent was still 0 and was changed to 1. So the question is how can i compute whatever is value entered in day_absent before it gets saved? class PayrollTransactionUpdate(LoginRequiredMixin,UpdateView): model = t_pay template_name = 'payroll/transaction/update.html' fields = ['day_absent'] def post(self,request,pk): emp = t_pay.objects.get(pk=pk) emp.amt_absent = emp.day_absent * emp.amt_rate emp.save() return super().post(request) -
Using Django's annotate function while referencing another model?
I have a three models: a User, Movie, and Rating model: class User(models.Model): user_id = models.IntegerField(primary_key=True) class Movie(models.Model): movie_id = models.IntegerField(primary_key=True) imdb_rating = models.FloatField(null=True) rt_rating = models.IntegerField(null=True) class Rating(models.Model): rating_id = models.IntegerField(primary_key=True) user = models.ForeignKey( User, on_delete=models.CASCADE, related_name='ratings' ) movie = models.ForeignKey( Movie, on_delete=models.CASCADE, related_name='ratings' ) rating = models.FloatField() For Rating, I would like to annotate in a way where I have the difference of the Rating.rating and Movie.imdb_rating. I also have userRatings which contains only the ratings by user with id = 1, to simplify things. I tried using userRating.annotate(imdb_diff=Value('rating') - Value('movie__imdb_rating')) But I get the error django.core.exceptions.FieldError: Cannot resolve expression type, unknown output_field How would I go about getting the correct annotation. -
After multiple requests send to the server 500 (Internal Server Error)
I am working on the Django application where I want to create multiple asynchronous requests with ajax to django server. It works fine if there is less than 5 asynchronous requests but if there is more requests django return 500 (Internal Server Error) for some of the requests. If I make synchronous ajax requests it works fine. Code where I send multiple ajax requests: for (i=2; i <= lastIndex; i++){ pidForm['page_index'] = i; $.ajax({ type: 'POST', url: '{% url "search_by_pid" %}', data: pidForm, success: function (data) { console.log(data); $(data.api_response.bugs).each(function(index, bugs){ var id = bugs.id; createInnerHtml(id); }); } }) } My django view, where I send the ajax request: def get_bug_by_pid(request): product_id_form = ProductIdForm() if request.method == 'GET': return render(request, 'search_bug_by_pid.html', {'page_title': 'ProductID', 'product_id_form': product_id_form}) elif request.method == 'POST': product_id = request.POST['product_id'] if 'page_index' in request.POST: api_call = ApiCall() page_index = request.POST['page_index'] api_response = api_call.bug_api_call_by_pid(product_id, page_index) return JsonResponse({'api_response': api_response,'product_id': product_id}) Any idea how can I solve the problem or what I am doing wrong? -
How can i connect a modelfield with a particular information belonging to him?
I am making a web app that will handle cricket matches what I need to do is to assign an specific information belonging to a model field For e.g it's player1 so I have to make it able for the user to assign the information belonging to that particular field like what's his batting turn etc. How should I make the models for this situation -
How to appen early message at top of GiftedChat?
Guys I only find GiftedChat.append function available to add new message to it. It works well for new incoming messages because they are usually display at the bottom og list. However, we need to early messages goes to top of list. But append function couldn't work for this situation. Does any one knows how to work out this one. -
How to make a extra serializer field without implementation in create method in Django Rest Framework
I want to include a serializer field which will be used inside the serializer class only for data checking, no implementation in create method class StudentDataMigrateSerializer(serializers.Serializer): name = serializers.CharField() sex = serializers.CharField() registration_no = serializers.CharField() #registration = serializers.CharField() def create(self,validated_data): name = validated_data.pop('name') sex = validated_data.pop('sex') registration_no = validated_data.pop('registration_no') #check for existence of registration number Student.objects.CheckRegistration(name,registration_no) student = Student.objects.create(name=name, sex=sex) return student I get the following error AttributeError at /migrate/student Got AttributeError when attempting to get a value for field registration_no on serializer StudentDataMigrateSerializer. The serializer field might be named incorrectly and not match any attribute or key on the Student instance. Original exception text was: 'Student' object has no attribute 'registration_no'. -
How to order the queryset according to "some field" in UserProfile?
I am trying to get all the users in auth_user table but I want to order them by a field (updated_at) which is in userprofile table. I made this relation according to the recommended OneToOneField relation in Django documentation. I am trying this method to get the ordered result- users = User.objects.order_by("userprofile__updated_at") but this method doesn't seem to work. I have also tried this - users = User.objects.all()order_by("userprofile__updated_at") Can anyone help me with this thing ? -
Django Admin Form DateTime Field, display in users system-time but save as UTC
I want the users on Django admin form to see the time in their own local / system time but store it as UTC on the DB. I researched this and got a lot of confusing information, how would you deal with this? My current settings are: LANGUAGE_CODE = 'en-us' TIME_ZONE = 'UTC' USE_I18N = True USE_L10N = True USE_TZ = True -
Django 2.1: Image upload form code displays no error - image not saved
1) in models.py: class SeekerProfile(models.Model): user = models.OneToOneField(User, on_delete=models.CASCADE) #other fields photo = models.ImageField(upload_to='images/', null=True, blank=True) 2) in views.py @login_required def handle_uploaded_file(f): with open('some/file/name.txt', 'wb+') as destination: for chunk in f.chunks(): destination.write(chunk) @login_required def seeker_profile_update (request,template_name='munichlivingapp/seeker_myprofile_edit.html'): logged_in_type = "Seeker" u = User.objects.get(username=request.user) seeker_obj = SeekerProfile.objects.get(user=u) usereditform = UserEditForm(request.POST or None, instance=u) seekerprofileeditform = SeekerProfileEditForm(request.POST or None, request.FILES or None, instance=u.seekerprofile) if request.method == 'POST': if usereditform.is_valid(): user = usereditform.save() seekerprofileeditform_aux = SeekerProfileEditForm(data=request.POST, files=request.FILES) if seekerprofileeditform_aux.is_valid() and 'photo' in request.FILES: seeker_obj.photo.delete() seeker_obj.save() if seekerprofileeditform.is_valid(): if 'photo' in request.FILES: handle_uploaded_file(seeker_obj.photo) seeker_obj.save() return redirect('seeker_myprofile') else: return render(request, template_name, {'usereditform': usereditform, 'seekerprofileeditform': seekerprofileeditform, 'logged_in_type': logged_in_type }) The above code works, the template is rendered with no errors. For some reasons, the image file is never saved. -
Django Form FileField/ImageField how to clear it?
I have a Django ModelForm connected to a Django Model with an ImageField: photo = models.ImageField(upload_to='athletes/', blank=True, default='') This is the way I am setting up my form: def get_form(info, **input): pk = input.pop("id", None) form_kwargs = {} if pk: instance = Person.objects.get(pk=pk) form_kwargs["instance"] = instance print(input) return PersonForm(input, info.context.FILES, **form_kwargs) This is the output of the print: { 'name': 'John Doe', 'photo': None, 'discipline': 'Triathlon' } I am trying to update an existing model by clearing the photo attribute. I have tried setting photo to None or to empty string '' but nothing clears the photo. Replacing the photo with another one works. As far as I understand, because "photo" is an ImageField, it can only be set from the files argument (second argument in the form). How can I clear a File/ImageField field from the form? Thanks! -
My contact form is not working properly in django?
this is the application where a random users can fill the contact form and can send message to the admin. This code is not giving any error and it is storing all the contact details in database but it is not sending email message to my email address. models.py class Contact(models.Model): name = models.CharField(max_length=50) email = models.EmailField() phone = models.CharField(max_length=15) subject = models.CharField(max_length=100) message = models.TextField() def __str__(self): return self.subject views.py def contact(request): if request.method == "POST": form = ContactForm(request.POST) if form.is_valid(): subject = form['subject'].value() message = form['message'].value() email = form['email'].value() recipients = [settings.EMAIL_HOST_USER] send_mail(subject, message, email, recipients,fail_silently=True) form.save() messages.success(request,'Message Sent.') return redirect('shop:contact') else: messages.error(request,'Error in Form') else: form = ContactForm() return render(request,'shop/contact.html',{'form':form}) forms.py class ContactForm(forms.ModelForm): class Meta: model = Contact fields = ['name','phone','email','subject','message'] contact.html {% extends "shop/base.html" %} {% load bootstrap4 %} <title>{% block title %}Contact{% endblock %}</title> {% block content %} <center>{% bootstrap_messages %}</center> <div class="container"> <div class="row"> <div class="col-lg-4 offset-lg-4 col-sm-10 offset-sm-1"> <div class="card my-5"> <div class="card-header text-center"> Contact </div> <div class="card-body"> <form action="" method="post"> {% csrf_token %} {% bootstrap_form form %} <input type="submit" class="btn btn-success text-center w-100 mb-3" value="Contact"> </form> </div> </div> </div> </div> </div> {% endblock %} settings.py EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend' EMAIL_USE_TLS = True EMAIL_HOST … -
Multiple buttons with same function call, but alert only showing for the first button
I've been messing around with Vue.js and Django and I added a function call to a button. The button is shown multiple times for each different type of food there is, but the alert is only shown when the very first button is clicked. What could be the cause? Django template: {%if context%} {%for fooditem in context%} <div id = "vue-app2"> <button class = "btn-foodname" v-on:click="changeFoodName()">{{fooditem.food_name}}</button> <p>{{fooditem.country_of_origin}}</p> </div> {%endfor%} {%else%} <p>Nothing to see here</p> {%endif%} JS: var x = new Vue({ el: '#vue-app2', data:{ new_message: 'Yes, this is a good food!' }, methods:{ changeFoodName: function(){ alert(this.new_message); } } }); -
Link 2 fields from a model in django
I am relatively new to Django and I made a Todo list where user can add a task and mark if its completed. I added a form field of priorities which is a radio select widget. Based on the priority the task field will have red, orange or green color. The radio buttons appear correctly and I cant post a task without giving an input priority. But the priority is always taken as default(high). I tried a couple of things to change and display the priorities but nothing worked. I believe something in the views.py is to be modified to make it work but due to my lack of experience I cannot put a finger on it. Views.py @require_POST def addTodo(request): form = TodoForm(request.POST) #print(request.POST['text']) if form.is_valid(): new_todo = Todo(text = request.POST['text']) new_todo.save() for item in form: return redirect('index') def completeTodo(request, todo_id): todo = Todo.objects.get(pk=todo_id) todo.complete = True todo.save() return redirect('index') form.py from django import forms prior_choice =[('high','High'),('mod','Mod'),('low','Low')] class TodoForm(forms.Form): text = forms.CharField(max_length = 40, widget = forms.TextInput( attrs= {'class': 'form-control', 'placeholder': 'Enter todo e.g. Delete junk files', 'aria-label': 'Todo', 'aria-describedby':'add-btn'})) priority = forms.CharField(widget=forms.RadioSelect(choices=prior_choice)) models.py from django.db import models class Todo(models.Model): text = models.CharField(max_length=40) complete = models.BooleanField(default = False) task_priority … -
Database routing by hostname
I want to route the specific request on a host to different database for example My default app is running on www.example.com if user requests on www.sub.example.com I want to use a different database. I can get the hostname by request.META['HOST'] and I tried something like this class MultipleDatabaseRequestRouterMiddleware (object): def process_view( self, request, view_func, args, kwargs ): request.META['HOST'] def process_response( self, request, response ): return response class DatabaseRouter(object): def db_for_read(self, model, **hints): return None def db_for_write(self, model, **hints): return None My problem is my DatabaseRouter is not aware of request here how can I pass request into DatabaseRouter? -
How to implement 'Buy Now' feature in Django oscar
I have a feature to implement, I have a 'buy now' button along with the add to cart button,what the 'Buy Now' must do is, once a customer clicks this, it must add 1 product, which might have variants to a new basket, irrespective of what is in the user's current basket and go directly to checkout, i.e the shipping address page and they can proceed with the further steps, while the add to cart button does the same what it is currently doing. I am not sure how to implement this, I thought of using the add_to_basket_form_compact but it just adds 1 product to the existing basket.Has anyone tried this in Django Oscar? My Django version == 2.1.7, Django-Oscar==1.6.7, Python 3.6.3 -
Getting Typeerror: can't concat str to bytes, when writing a test case to enter request files in django rest framework?
I was working on a project where I can add a csv to upload shirts details to the database. I wrote a viewset that takes shirt csv files input from request.data in django rest framework, and am writing a test case for the same. Though, while writing the test case, rather than creating a seperate csv file, I created a csv from pandas dataframe inside the test case, and converting it into TextIOWrapper to pass as request data. Doing this throws the following error: File "/Users/prasoon/projects/shirt_details/post_shirt_csv/tests/test_post_shirt_dataset.py", line 175, in test_shirt_dataset_post response = self.api_client.post(reverse('post-shirt-csv-dataset', kwargs={'session_id': self.session.id}), {'csv_files': [fp1, fp2]}) File "/Users/prasoon/projects/venv/lib/python3.6/site-packages/rest_framework/test.py", line 300, in post path, data=data, format=format, content_type=content_type, **extra) File "/Users/prasoon/projects/venv/lib/python3.6/site-packages/rest_framework/test.py", line 212, in post data, content_type = self._encode_data(data, format, content_type) File "/Users/prasoon/projects/venv/lib/python3.6/site-packages/rest_framework/test.py", line 184, in _encode_data ret = renderer.render(data) File "/Users/prasoon/projects/venv/lib/python3.6/site-packages/rest_framework/renderers.py", line 920, in render return encode_multipart(self.BOUNDARY, data) File "/Users/prasoon/projects/venv/lib/python3.6/site-packages/django/test/client.py", line 198, in encode_multipart lines.extend(encode_file(boundary, key, item)) File "/Users/prasoon/projects/venv/lib/python3.6/site-packages/django/test/client.py", line 247, in encode_file to_bytes(file.read()) File "/Users/prasoon/projects/venv/bin/../lib/python3.6/codecs.py", line 320, in decode data = self.buffer + input TypeError: can't concat str to bytes The thing works when I am opening a file and passing it instead of creating the string. It will be more clear below: The tests file is: class … -
How do i only show the latest post from the local user?
I have called the latest post but i want the post shown to be related to whoever is using the website calculation = [Math.objects.latest('date')] calc = getattr([Math.objects.latest('date')][0], 'calculation') When switching computer and using running the server again the latest post was still there. Does this happen because python manage.py runserver can't tell by IP? My biggest issue would be if when deployed, the latest post anyone has posted will be shown For context i will be using this site for computations which is why they need to be personalized -
Django ORM: how to make multi-conditional filter on related field?
For example we have these models: Order (name, ...) Product(order, name, a, b, c) And I want to exclude orders where all products satisfy condition (p.a > 0 or p.b > 0) and p.c == 0. What I have tried so far: Order.objects.all().exclude( Q(products__a__qt=0) | Q(products__b__qt=0), products__c=0, ) But got some strange error: MultiJoin django.core.exceptions.FieldError: Unsupported lookup 'qt' for IntegerField or join on the field not permitted. -
Change Django autocomplete_fields label
I'm trying to set a custom label for all of the items of a type in autocomplete_fields. Until now, for a drop-down list, one would use ... class CustomDisplay(forms.ModelChoiceField): def label_from_instance(self, obj): return "Some custom text: {}".format(obj.name) ... somethings = CustomDisplay(queryset=Something.object.all()) ... but using this with autocomplete_fields = (somethings,) will result in autocomplete canceling and showing me a dropdown with the custom text. -
KeyError: 'collectstatic' When deploying the Django application to pythonanywhere
During the implementation of my Django application on pythonanywhere for the first time I encountered such an error. Previous applications with a very similar structure were able to be implemented without any problem Traceback (most recent call last): File "/home/ebluedesign/.virtualenvs/ebluedesign.pythonanywhere.com/lib/python3.5/site-packages/django/core/management/__init__.py", line 204, in fetch_command app_name = commands[subcommand] KeyError: 'collectstatic' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/ebluedesign/ebluedesign.pythonanywhere.com/manage.py", line 15, in <module> execute_from_command_line(sys.argv) File "/home/ebluedesign/.virtualenvs/ebluedesign.pythonanywhere.com/lib/python3.5/site-packages/django/core/management/__init__.py", line 381, in execute_from_comman d_line utility.execute() File "/home/ebluedesign/.virtualenvs/ebluedesign.pythonanywhere.com/lib/python3.5/site-packages/django/core/management/__init__.py", line 375, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/home/ebluedesign/.virtualenvs/ebluedesign.pythonanywhere.com/lib/python3.5/site-packages/django/core/management/__init__.py", line 211, in fetch_command settings.INSTALLED_APPS File "/home/ebluedesign/.virtualenvs/ebluedesign.pythonanywhere.com/lib/python3.5/site-packages/django/conf/__init__.py", line 79, in __getattr__ self._setup(name) File "/home/ebluedesign/.virtualenvs/ebluedesign.pythonanywhere.com/lib/python3.5/site-packages/django/conf/__init__.py", line 66, in _setup self._wrapped = Settings(settings_module) File "/home/ebluedesign/.virtualenvs/ebluedesign.pythonanywhere.com/lib/python3.5/site-packages/django/conf/__init__.py", line 157, in __init__ mod = importlib.import_module(self.SETTINGS_MODULE) File "/home/ebluedesign/.virtualenvs/ebluedesign.pythonanywhere.com/lib/python3.5/importlib/__init__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 985, in _gcd_import File "<frozen importlib._bootstrap>", line 968, in _find_and_load File "<frozen importlib._bootstrap>", line 957, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 673, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 697, in exec_module File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed File "/home/ebluedesign/ebluedesign.pythonanywhere.com/app_rama/settings.py", line 14, in <module> from decouple import config ImportError: No module named 'decouple' Traceback (most recent call last): File "/home/ebluedesign/.local/bin/pa_autoconfigure_django.py", line 52, in <module> main(arguments['<git-repo-url>'], arguments['--domain'], arguments['--python'], nuke=arguments.get('--nuke')) File …