Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
How to save the generated image from Django ImageKit to ImageField?
I generate the image using the code below: source_file = open('/path/to/myimage.jpg', 'rb') image_generator = Thumbnail(source=source_file) result = image_generator.generate() What is the proper method to save the generated "result" back to ImageField? The generated result seem to _io.BytesIO object. And it seems it seems I cannot directly save it to ImageField. Any help would be appreciated -
Create a lesson schedule with django-sheduler
I'm using django-scheduler for a school project. The idea is to make a schedule of lessons like this: shedule of school Through a "relationship with the event", the subject.model can be present in the schedule, this subject is associated to a course.model through a foreignkey and each course has a list of students. I would like to know in which subject / event a student is at a certain moment through the calendar. Can this be done? Do the events send a signal when they happen? *I'm still trying to understand how to get the subject's relationship with the event, this is not a documented option -
Is it possible to get twitter access_token without Backend?
I am trying to build an app which has Django DRF Backend and React Frontend. I used 'oauth2_provider' and 'rest_framework_social_oauth2' on Backend. I succeeded to get the facebook access_token by only using React Frontend. Send it to Backend and get the converted token. In case of twitter, is it possible to get tha access_token by only using React? Looking forward to your adivce. :) -
Can we do a Sum on CharField in Django ORM?
Model is - class Test(Modelbase): id = models.IntegerField(null=True, blank=True) amount = models.CharField(max_length=255) I want to add the amount for list of id's. The only problem is the amount field is CharField. How do I apply sum for the amount field? Test.objects.filter(id__in=[1,2,3]).aggregate(Sum('amount')) I am using Django=1.9.1 for this. -
Use Yarn to manage node modules in a Django app with docker
Basically what I'm trying to do is install packages such as Jquery, gulp, babel, etc, via Yarn on a Docker container. I've tried something like this in my Dockerfile FROM python:3.6.5 RUN apt-get update -y && apt-get install apt-transport-https -y RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list RUN apt-get update -y && apt-get install yarn -y RUN mkdir /code WORKDIR /code ADD requirements.txt /code/ RUN pip install -r requirements.txt ADD . /code/ But it does not work. I'm new using Docker so I really appreciate the help you could give me. PS: the main idea is to use yarn like docker exec -it <container> yarn add <package>. BTW I'm working on Fedora 26. -
How to get and save token using Django Web service
I'm not sure I'm right on track. Please give me a hint or direction. I set up my Web service using Django and also made mobile app with React Native using Django REST framwork. Django uses the basic session authentication, but Django REST API uses token authentication to process the request from mobile app. I want to implement small ReactJS app into my existing Django web. At this stage, I think my small react app will need auth token to communicate with REST api for itself. So, my idea is that when user logs in web login page, user's API token needs to be received from API and save into cookie or localStorage while normal log in process is processing in Django Web service. Am I right on track? if so, how can I make it works? Please refer to my code in Django login view.py Do i need to some code in order to get API auth token and save it into client side? def Login(request): if not request.user.is_authenticated: if request.method == "POST": email = request.POST['email'] password = request.POST['password'] user = authenticate(email = email, password = password) if user is not None: login(request, user) messages.add_message(request, messages.SUCCESS, request.user.nickname + ' … -
Django Rest Framework custom exception handling doesn't recognize parameter
I am following the answer to the question Django REST Framework how to specify error code when raising validation error in serializer in order to custom exception handling, but i get an error. This is my custom exception handler: from rest_framework.exceptions import APIException from django.utils.encoding import force_text from rest_framework import status class CustomValidation(APIException): status_code = status.HTTP_500_INTERNAL_SERVER_ERROR default_detail = 'A server error ocurred' def __init__(self, detail, field, status_code): if status_code is not None: self.status_code = status_code if detail is not None: self.detail = {field: force_text(detail)} else: self.detail = {'detail': force_text(self.default_detail)} This is where I raise the exception: class UserSerializer(serializers.HyperlinkedModelSerializer): class Meta: model = User fields = ('id', 'username', 'first_name', 'last_name', 'email', 'password') def create(self, validated_data): try: user = models.User.objects.get(email=validated_data.get('email')) except User.DoesNotExist: user = models.User.objects.create(**validated_data) user.set_password(user.password) user.save() Token.objects.create(user=user) return user else: raise CustomValidation('eMail already in use', 'email', status_code=status.HTTP_409_CONFLICT) And this is the traceback that I get: Internal Server Error: /es/users_manager/users/ Traceback (most recent call last): File "/Users/hugovillalobos/Documents/Code/IntellibookProject/IntellibookVenv/lib/python3.6/site-packages/rest_framework/views.py", line 480, in dispatch response = handler(request, *args, **kwargs) File "/Users/hugovillalobos/Documents/Code/IntellibookProject/IntellibookVenv/lib/python3.6/site-packages/rest_framework/mixins.py", line 21, in create self.perform_create(serializer) File "/Users/hugovillalobos/Documents/Code/IntellibookProject/IntellibookVenv/lib/python3.6/site-packages/rest_framework/mixins.py", line 26, in perform_create serializer.save() File "/Users/hugovillalobos/Documents/Code/IntellibookProject/IntellibookVenv/lib/python3.6/site-packages/rest_framework/serializers.py", line 214, in save self.instance = self.create(validated_data) File "/Users/hugovillalobos/Documents/Code/IntellibookProject/Intellibook/UsersManagerApp/serializers.py", line 25, in create raise CustomValidation('eMail already in use', 'email', status_code=status.HTTP_409_CONFLICT) … -
How to use csrf_token in Django RESTful API and React?
I have previous experience in Django. If add line {csrf_token} in Django templates then Django handles the functionalities of csrf_token. But when I am trying to develop an API using Django REST Framework then I get stuck. How can I add and handle functionalities like csrf_token in API (back end, developed using Django REST Framework) and React Native/React JS (front end) like Django templates? -
Check if user is following user?
I have a DetailView which renders the profile page like so: class ProfileView(DetailView): model = User slug_field = 'username' template_name = 'oauth/profile.html' context_object_name = 'user_profile' The User model contains fields about the user like id, username, email, password I also have another model that has a one to many relationship with this User model. It shows who the User is following like so: class Following(models.Model): target = models.ForeignKey('User', related_name='followers', on_delete=models.CASCADE, null=True) follower = models.ForeignKey('User', related_name='targets', on_delete=models.CASCADE, null=True) def __str__(self): return '{} is followed by {}'.format(self.target, self.follower) Inside my template, I have the following logic: <form method="post" action=""> {% csrf_token %} {% if user in user_profile.followers %} <input type="submit" class="item profile-nav__follow-btn" value="Following"> {% else %} <input type="submit" class="item profile-nav__follow-btn" value="Follow"> {% endif %} </form> I'm trying to check if the user is following that specific user. However, even though it should be true, the Follow input button is shown instead. What is wrong with my logic? Why isn't the Following input button being shown instead? -
random string in django view
I am trying to generate a random string to add to my model when a user performs an action, here is the code in my view: def create_proposal (request, conversation_pk): key_value = get_random_string(14) if request.method == "POST": form = PostProposal(request.POST) if form.is_valid(): p = one.objects.create( key= key_value, [...] ) However the code is generating a 12 key string instead of 14, which kept me puzzled. But in the end I am tring to get only uppercase letters and numbers (I am trying to avoid confusion between l and I :). ) Any help would be appreciated. -
TypeError: object() takes no parameters when trying to admin.site.register
all of other models registered sucsessfully, exept one: trying to admin.site.register(ProductImage, ProductImageAdmin) classes: in products/models.py: class ProductImage(models.Model): product = models.ForeignKey(Product, on_delete=models.CASCADE, blank=True, null=True, default=None) image = models.ImageField(upload_to='product_images/') is_active = models.BooleanField(default=True) created = models.DateTimeField(auto_now_add=True, auto_now=False) updated = models.DateTimeField(auto_now_add=False, auto_now=True) def __str__(self): return ('Phpoto %s' % (self.id)) class Meta: verbose_name = 'photo' in products/admin.py: class ProductImageAdmin: list_display = [field.name for field in ProductImage._meta.fields] exclude = [] class Meta: model = ProductImage error is: File "C:\Dev\tst\products\admin.py", line 22, in admin.site.register(ProductImage, ProductImageAdmin) File "C:\Users\Anti-\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\contrib\admin\sites.py", line 124, in re gister self._registry[model] = admin_class(model, self) TypeError: object() takes no parameters is that something special for ImageField? -
Python's counter() function is too slow
I am using Django REST framework and there is a post API that I am facing speed issue in the line where i am using Counter() function. @api_view(["POST"]) def calculate_stuff(request): t1 = time.time() machine_type = request.data['machine_type'] machine_nos = Machine.objects.filter(machine_type=machine_type).values_list('machine_no', flat=True) query = Performance.objects.filter(Q(power=100) | Q(power=192),machine_no__in=machine_nos, ).values_list("machine_no", "power") t2 = time.time() print t2 - t1 # is around 0.2 seconds count_192_100 = Counter(query) t3 = time.time() print t3 - t2 # is around 1.3 seconds My question is that why does it take so much time for Counter to calculate counts and is there any alternative method to do what Counter does in less time ? Additional info: I am using Django 1.11, python 2.7.10, postgresql. -
How to display image from model in Django
To be clear, I have tried researching this on my own but since I'm still very new to Django I am unable to understand the solutions here. I also have read the documentation and I don't understand what I'm doing wrong. I cannot get the images located in the "ad_pictures" directory to display in the HTML. Here's my code: settings.py STATIC_URL = '/static/' MEDIA_ROOT = os.path.join(BASE_DIR, 'media') MEDIA_URL = '/media/' urls.py (project) from django.conf.urls import url, include from django.contrib import admin from django.conf import settings from django.conf.urls.static import static urlpatterns = [ url(r'^admin/', admin.site.urls), url(r'^accounts/', include('accounts.urls')), url(r'^classifieds/', include('classifieds.urls')), ] +static(settings.MEDIA_URL, document_ROOT=settings.MEDIA_ROOT) urls.py (classifieds app) from django.conf.urls import url from . import views app_name = 'classifieds' urlpatterns = [ url(r'^create/', views.create, name='create'), url(r'^latestads/', views.latestads, name='latestads'), ] models.py class Post(models.Model): title = models.CharField(max_length=150) price = models.CharField(max_length=100) body = models.TextField() pub_date = models.DateTimeField(null=True) author = models.ForeignKey(User, null=True) category = models.CharField(max_length=150, null=True) picture = models.ImageField(upload_to='ad_pictures', default='') latestads.html {% for post in posts.all %} <div class="advertisements"> <div class="a-title"> <h3><a href="">{{ post.title }}</a></h3> </div> <div class="a-image"> <a href=""><img src="{{ post.picture.url }}"></a> </div> <div class="a-content"> <p>{{ post.body }}</p> </div> <div class="a-date"> <p>{{ post.pub_date }} by {{ post.author }}</p> </div> </div> <img src="{{ post.image.url }}"> {% endfor %} … -
Javascript Failure On Live Server
I have a website on which user can comment something below the posts, powered by Python & Django. I'm updating comments without refreshing the webpage. Here's the code, In views.py postType1 = sorted(Posts.objects.filter( . . . ), key=lambda x: random.random()) postType2= Posts.objects.filter( . . . ) In template, // BLOCK - 1 {% for post in postType1 %} <p>{{ post }}</p> <div class="comm_update" action="{% url 'comment:create' post.id %}"> <form class="comm_form" action="{% url 'comment:create' post.id %}" method="post" enctype="multipart/form-data"> {% csrf_token %} <textarea id="id_comment"></textarea><br /><br /> <button type="submit">Submit</button> </form> </div> {% endfor %} <hr /> // BLOCK - 2 {% for post in postType2 %} <p>{{ post }}</p> <div class="comm_update" action="{% url 'comment:create' post.id %}"> <form class="comm_form" action="{% url 'comment:create' post.id %}" method="post" enctype="multipart/form-data"> {% csrf_token %} <textarea name="comment_text" id="id_comment"></textarea><br /> <button type="submit">Submit</button> </form> </div> {% endfor %} Auto updating comments without refreshing webpage, $(document).on("submit", ".comm_form", function(t) { t.preventDefault(); var o = $(this), e = $.post(o.attr("action"), o.serialize()), n = o.attr("action"); e.done(function(t) { var e = $(t).find(".comm_update[action='" + n + "']"); o.closest(".comm_update").html(e), o[0].reset() }) }); On production server localhost everything is working fine. *But on live server the first block BLOCK - 1 is not updating the comments, instead when user presses submit … -
Django access FormSet data and put in pandas Dataframe
I am trying to generate formset which would look like this. formset output needed and then access formset data to put it into pandas dataframe for calculation that could be accessible in another python .py file. However, my code does not fetch any user input to me once I test it. Please advise what should be done to fix it? views.py from django.shortcuts import render from django.http import HttpResponse from django.http import HttpResponseRedirect from django.shortcuts import render from .forms import AssumptionsForm, AssumptionsFormSet from django.forms import formset_factory data_list = [] def index(request): return HttpResponse("Hello, client. You're at the inputs page.") def get_assumptions(request): if request.method == 'POST': formset = AssumptionsFormSet(request.POST) if formset.is_valid(): for f in formset: cd = f.cleaned_data data1 = cd.get('bad') data2 = cd.get('likely') data3 = cd.get('best') data_list.append(data1) data_list.append(data2) data_list.append(data3) else: formset = AssumptionsFormSet() return render(request, 'assumptions.html', {'formset': formset}) assumptions.html <form action="/analysis2/" method="post"> {% csrf_token %} <table> {% for form in formset %} {{ form }} {% endfor %} </table> <input type="submit" value="Submit" /> </form> forms.py from django import forms from django.forms import formset_factory class AssumptionsForm(forms.Form): #title = forms.CharField() bad = forms.FloatField() likely = forms.FloatField() best = forms.FloatField() AssumptionsFormSet = formset_factory(AssumptionsForm, extra = 5) -
context must be a dict rather than set
I am just starting to learn Django and I created a 'blog' app by following someone's youtube video. I think there is django version difference,there is some problems. This is my view.py: from django.shortcuts import render from .models import Post def list_of_post(request): post = Post.objects.all() template = 'blog/post/list_of_post.html' context = {'post',post} return render(request,template,context) The error is : TypeError at /blog/ context must be a dict rather than set. Request Method: GET Request URL: http://127.0.0.1:8000/blog/ Django Version: 2.0.5 Exception Type: TypeError Exception Value: context must be a dict rather than set. Exception Location: /Users/sumeixu/anaconda3/lib/python3.6/site-packages/django/template/context.py in make_context, line 274 Python Executable: /Users/sumeixu/anaconda3/bin/python Python Version: 3.6.3 Python Path: ['/Users/sumeixu/djangotest', '/Users/sumeixu/anaconda3/lib/python36.zip', '/Users/sumeixu/anaconda3/lib/python3.6', '/Users/sumeixu/anaconda3/lib/python3.6/lib-dynload', '/Users/sumeixu/anaconda3/lib/python3.6/site-packages', '/Users/sumeixu/anaconda3/lib/python3.6/site-packages/aeosa'] Server time: Thu, 7 Jun 2018 01:22:41 +0000 I would very appreciate it if you could help me out. -
GEOS - SHA256 MISMATCH
When i tried to do brew install geos I get the following error: SHA256 mismatch Expected: 045a13df84d605a866602f6020fc6cbf8bf4c42fb50de237a08926e1d7d7652a Actual: 4a2e4e3a7a09a7cfda3211d0f4a235d9fd3176ddf64bd8db14b4ead266189fc5 Archive: /Users/catherinegener/Library/Caches/Homebrew/geos-3.6.1.tar.bz2 To retry an incomplete download, remove the file above. I tried removing the archive specified and install geos again but it fails once again. I tried brew doctor and it tells me to install the geos dependency. Also, when i do brew edit geos the sha256 does match the expected one. Here is part of the output i get when i run brew edit geos: class Geos < Formula desc "Geometry Engine" homepage "https://trac.osgeo.org/geos" url "http://download.osgeo.org/geos/geos-3.6.1.tar.bz2" sha256 "045a13df84d605a866602f6020fc6cbf8bf4c42fb50de237a08926e1d7d7652a" bottle do cellar :any sha256 "02aa28dcfd38747e924fa486b1607c90ddf5e18c7a400510e3d7f12ef6b90d86" => :sierra sha256 "b4f3fd82b0f39f109ff3da7d5027471c8c2bc8f39bc24198af145df9d3576a71" => :el_capitan sha256 "5b20acb4dfa59515brbe97f9f731f497c59d11deee2547ca61191b0da4eb8cf735" => :yosemite end option :cxx11 option "without-python", "Do not build the Python extension" option "with-ruby", "Build the ruby extension" depends_on "swig" => :build if build.with?("python") || build.with?("ruby") def install ENV.cxx11 if build.cxx11? Please help -
python dictionary can be used as a function value?
I want to send a dictionary to my function. but i get a error message like this. 'save_userinfo() got an unexpected keyword argument 'is_superuser'' userinfo = { 'password_new_1' : request.POST.get('password_new_1', False), 'password_new_2' : request.POST.get('password_new_2', False), 'username' : request.POST.get('username', False), 'email' : request.POST.get('email', False), 'first_name' : request.POST.get('first_name', False), 'last_name' : request.POST.get('last_name', False), 'is_superuser' : request.POST.get('is_superuser', False), 'is_staff' : request.POST.get('is_staff', False), 'is_active' : request.POST.get('is_active', False) } functionname.save_userinfo(user, **userinfo) -
django admin detail page showing blank without error
It is really weird that when I go into my django admin dashboard, choose one of the model under an app then go into one of the row's detail. The detail is just a blank. For example, I have an app named Product then a model named Sku under the product app. And of course there are quite data in the sku but when I click into one of the sku's data, the page is blank. Steps for example, I login into my django admin dashboard I see the sku model listed under product app clicked the sku then see a list of sku info I choose one of the sku info to click into I should then see the detail of this sku I clicked but instead I see blank page without errors This does not apply to all models just 1-2 models anyone have any idea reason and where I should look into? P.S. I tried to use python manage.py collectstatic also, my development is totally fine though. Anyone has idea what might be the reason? Thanks in advance for any help. -
Django: Exception Value: Cannot assign: "Visit.fk_visit_main" must be a "Main" instance
The user is in a DetailView of a patient with a in id (parent table/model), or selects a patient to create a child (table/model) object (I hope that is accurate terminology). I'm trying to "pre-populate" my form with the correct foreign key from the parent table. Basically, Each patient will have several visits, and the visits need to have the correct foreign key relationships with the patient table ("main" model). I am getting the following error relating to my def form_valid command in the views.py file. If I remove this command I get a not null error as the field needs to be filled. Error Cannot assign "2": "Visit.fk_visit_main" must be a "Main" instance. SQLite3 Content The first column is the primary key (2). Just to show that it is definately in my database. sqlite> select * from clincher_main; 2|Jake Peralta|06/07/1983| 3|Nicolas Smoll|06/07/1983| 4|Rosa Diaz|07/09/1979| Models.py from django.db import models from django.urls import reverse from django.contrib.auth.models import User class Main(models.Model): name = models.CharField(max_length = 256) date_of_birth = models.CharField(max_length = 256) age = models.CharField(max_length=4) def get_absolute_url(self): return reverse('clincher:main-detail', kwargs={'pk': self.pk}) def __str__(self): return self.name + ' - ' + self.date_of_birth class Visit(models.Model): fk_visit_main = models.ForeignKey(Main, on_delete=models.CASCADE, verbose_name=('Patient Name')) visit_date = models.DateField(auto_now … -
Does cache mean no condition statements till it expires?
Hello Awesome People! With Django, I have a function that requires many calculations to display, but frankly doesn't need to be calculated each time you visit the view. So I use Django cache. Before accessing the function, I have a decorator that checks whether the user is active or not. @access_to('active_user') # i.e `if not request.user.is_active: PermissionDenied` @cache_page('one_week') # Not really that way def index(request,slug): all_models1 = Model1.objects.all() all_models2 = Model2.objects.all() all_models3 = Model3.objects.all() # Calculation to check the Model that a user has visited recently Let's have an example: User is active at 8:00 AM, and visits the view which has a cache that will expire after one week Image the SuperUser just changes user.is_active = False at 9:00 AM. Does it mean that the user will always have access until cache expires? Which data cache catches until it expires? Thank you for you further explanations! -
Is a follower-following table a many to many relationship?
I have two models. One model is a Users table which contains fields like id, username, email and I have another table which is used to show a follower and following relationship. The Following model is shown: class Following(models.Model): target = models.ForeignKey('User', related_name='followers', on_delete=models.CASCADE, null=True) follower = models.ForeignKey('User', related_name='targets', on_delete=models.CASCADE, null=True) def __str__(self): return '{} is followed by {}'.format(self.target, self.follower) I have made this assuming that the relationship between Users and Following is a one to many relationship (One user can have many followers, and can follow many as well). Is this correct? Or should it be a many to many relationship. If so, why? I have seen many instances of this table schema being both many to many and one to many. -
Django 'str' object has no attribute 'get'
I'm trying to redirect a user upon completion of a form to another page without saving. However, when I use the reverse function, I'm getting an error: 'str' object has no attribute 'get' In the below class based view, the self.object.thing_id prints the data it should. Class Based View: class ThingUpdateView(LoginRequiredMixin, UpdateView): def form_valid(self, form): if self.object.status != 'initiated': print(self.object.thing_id) return reverse('thing:detail', kwargs={'thing_id': str(self.object.thing_id) }) return super().form_valid(form) Even reverse('thing:list') gives the same error App Things' urls.py url(r'^$', ThingListView.as_view(), name='list'), url(r'^(?P<thing_id>[0-9A-Za-z]+)/$', ThingDetailView.as_view(), name='detail'), url(r'^update/(?P<thing_id>[0-9A-Za-z]+)/$', ThingUpdateView.as_view(), name='update'), -
Comment Auto Update Not Working on Live Server, But Working on Localhost
I have a website on which user can comment something below the posts, powered by Python & Django. I'm updating comments without refreshing the webpage. Here's the code, In views.py postType1 = sorted(Posts.objects.filter( . . . ), key=lambda x: random.random()) postType2= Posts.objects.filter( . . . ) In template, // BLOCK - 1 {% for post in postType1 %} <p>{{ post }}</p> <div class="comm_update" action="{% url 'comment:create' post.id %}"> <form class="comm_form" action="{% url 'comment:create' post.id %}" method="post" enctype="multipart/form-data"> {% csrf_token %} <textarea name="comment_text" id="id_comment"></textarea><br /> <button type="submit">Submit</button> </form> </div> {% endfor %} <hr /> // BLOCK - 2 {% for post in postType2 %} <p>{{ post }}</p> <div class="comm_update" action="{% url 'comment:create' post.id %}"> <form class="comm_form" action="{% url 'comment:create' post.id %}" method="post" enctype="multipart/form-data"> {% csrf_token %} <textarea name="comment_text" id="id_comment"></textarea><br /> <button type="submit">Submit</button> </form> </div> {% endfor %} Auto updating comments without refreshing webpage, $(document).on("submit", ".comm_form", function(t) { t.preventDefault(); var o = $(this), e = $.post(o.attr("action"), o.serialize()), n = o.attr("action"); e.done(function(t) { var e = $(t).find(".comm_update[action='" + n + "']"); o.closest(".comm_update").html(e), o[0].reset() }) }); On production server localhost everything is working fine. *But on live server the first block BLOCK - 1 is not updating the comments, instead when user presses submit … -
`pip3 freeze` prints many packages at the beginning
I created virtualenv and commanded pip3 freeze because I'm using python3 to run my project. virtualenv . source bin/activate pip3 freeze However, pip3 freeze printed default(?) python3 packages even though I didn't install any packages yet: backports.weakref==1.0rc1 bleach==1.5.0 certifi==2017.7.27.1 chardet==3.0.4 configparser==3.5.0 defusedxml==0.5.0 Django==1.11.12 django-allauth==0.32.0 django-crispy-forms==1.6.1 django-filter==1.0.4 django-widget-tweaks==1.4.1 djangorestframework==3.7.7 enum34==1.1.6 flake8==3.4.1 flake8-docstrings==1.1.0 flake8-polyfill==1.0.1 html5lib==0.9999999 idna==2.5 Keras==2.0.6 Markdown==2.6.8 mccabe==0.6.1 numpy==1.13.1 oauthlib==2.0.2 olefile==0.44 Pillow==4.2.1 protobuf==3.3.0 pycodestyle==2.3.1 pydocstyle==2.0.0 pyflakes==1.5.0 python3-openid==3.1.0 pytz==2018.3 PyYAML==3.12 requests==2.18.3 requests-oauthlib==0.8.0 scipy==0.19.1 six==1.10.0 snowballstemmer==1.2.1 tensorflow==1.2.1 Theano==0.9.0 urllib3==1.22 Werkzeug==0.12.2 Obviously I don't want to install tensorflow and Theano for my virtual machine. :( Why does it have default(?) python3 packages? Can we start it from scratch?