Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
Python/Django Фильтр товаров на сайте
Изучаю django и зашел в тупик по реализации фильтров на странице списка товаров. Модели: class Products(models.Model): date_create = models.DateTimeField(auto_now_add=True, verbose_name='Дата создания') date_edite = models.DateTimeField(auto_now=True, verbose_name='Дата изменения') category = TreeForeignKey('Category', on_delete=models.SET_NULL, null=True, blank=True, verbose_name="Категория", db_index=True) nazvanie = models.CharField(max_length=350, verbose_name='Название', db_index=True) kodtovara = models.CharField(max_length=50, verbose_name='Фирменный код', null=True, blank=True, db_index=True) article = models.CharField(max_length=50, verbose_name='Артикул', null=True, blank=True, db_index=True) slug = models.SlugField(blank=True) class PropertiesProduct(models.Model): nazvanie = models.CharField(max_length=500, verbose_name='Название', db_index=True) slug_nazvanie = models.SlugField(blank=True) znachenie = models.CharField(max_length=500, verbose_name='Значение', db_index=True) slug_znachenie = models.SlugField(blank=True) detail = models.BooleanField(null=True, blank=True, verbose_name='Использовать как свойство в описании товара', db_index=True, default=True) filter = models.BooleanField(null=True, blank=True, verbose_name='Использовать для фильтра', db_index=True, default=True) register = models.BooleanField(null=True, blank=True, verbose_name='Расширенные свойства', db_index=True, default=False) tovary = models.ForeignKey('Products', on_delete=models.SET_NULL, null=True, verbose_name='Товар', db_index=True) Модель свойства товаров имеет строковые поля для хранения названий свойств и значений у товаров, и поле привязку к товару. Свойства вынесены в отдельную таблицу так как они будут прилетать из 1С должны постоянно добавлятся/удалятся/редактироваться при обмене с 1С. В DB свойства хранятся как на фото из админки. Модель свойств товара Во фронтенде хочу вывести объединенный список для фильтра к примеру: Стандартный фильтр Подскажите где почитать о реализации фильтров на сайте, или может кто то уже реализовывал фильтрацию на сайте - поделитесь. Огромное спасибо. -
django.db.utils.ProgrammingError: relation "account_program" does not exist LINE 1: ...ated_date", "account_program"."updated_date" FROM "account_p
I am using Django 2.0.8 and using postgres DB. It was working fine when I started working on this project. I am facing this issue after uploading to heroku. I see this error when I run the code on my local database and the same code runs perfectly without issue on heroku DB. projectname/settings.py # SECURITY WARNING: don't run with debug turned on in production! DEBUG = True ALLOWED_HOSTS = [] # Application definition INSTALLED_APPS = [ 'account.apps.AccountConfig', 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'django.contrib.postgres', 'wagtail.contrib.forms', 'wagtail.contrib.redirects', 'wagtail.embeds', 'wagtail.sites', 'wagtail.users', 'wagtail.snippets', 'wagtail.documents', 'wagtail.images', 'wagtail.search', 'wagtail.admin', 'wagtail.core', 'modelcluster', 'taggit', 'empoweru', ] MIDDLEWARE = [ 'whitenoise.middleware.WhiteNoiseMiddleware', 'django.middleware.security.SecurityMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', 'wagtail.core.middleware.SiteMiddleware', 'wagtail.contrib.redirects.middleware.RedirectMiddleware', ] Error Traceback (most recent call last): File "C:\Users\nikes\Anaconda3\lib\site-packages\django\db\backends\utils.py", line 85, in _execute return self.cursor.execute(sql, params) psycopg2.ProgrammingError: relation "account_program" does not exist LINE 1: ...ated_date", "account_program"."updated_date" FROM "account_p... ^ The above exception was the direct cause of the following exception: Traceback (most recent call last): File "manage.py", line 15, in <module> execute_from_command_line(sys.argv) File "C:\Users\nikes\Anaconda3\lib\site-packages\django\core\management\__init__.py", line 371, in execute_from_command_line utility.execute() File "C:\Users\nikes\Anaconda3\lib\site-packages\django\core\management\__init__.py", line 365, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "C:\Users\nikes\Anaconda3\lib\site-packages\django\core\management\base.py", line 288, in run_from_argv self.execute(*args, **cmd_options) File "C:\Users\nikes\Anaconda3\lib\site-packages\django\core\management\base.py", line 332, in execute self.check() File "C:\Users\nikes\Anaconda3\lib\site-packages\django\core\management\base.py", line 364, in check … -
django rest framework error while post through json data
here is my models.py from __future__ import unicode_literals from django.db import models class User(models.Model): name = models.CharField(max_length=200) company_name = models.ForeignKey('Company',on_delete=models.CASCADE,related_name='user') def __str__(self): return self.name class Company(models.Model): name = models.CharField(max_length=200) phone_number = models.IntegerField(null=True,blank=True) def __str__(self): return self.name class Catalog(models.Model): name = models.CharField(max_length=200) no_of_pcs = models.IntegerField(null=True,blank=True) per_piece_price = models.DecimalField(null=True,blank=True,max_digits=10,decimal_places=2) company_name = models.ForeignKey(Company,on_delete=models.CASCADE,related_name='catalog') def __str__(self): return self.name Here is my serializers.py from rest_framework import serializers from .models import * from django.db.models import Sum,Count class CatalogSerializerPost(serializers.Serializer): id = serializers.IntegerField() name = serializers.CharField(required=False, allow_blank=True, max_length=100) no_of_pcs = serializers.IntegerField() per_piece_price = serializers.IntegerField() def create(self, validated_data): return Catalog.objects.create(**validated_data) class CatalogSerializer(serializers.ModelSerializer): total_pieces = serializers.SerializerMethodField() total_price = serializers.SerializerMethodField() class Meta: model = Catalog fields = ('name','no_of_pcs','per_piece_price','company_name','total_pieces','total_price') depth = 1 def get_total_pieces(self, obj): totalpieces = Catalog.objects.aggregate(total_pieces=Count('no_of_pcs')) return totalpieces["total_pieces"] def get_total_price(self, obj): totalprice = Catalog.objects.aggregate(total_price=Sum('per_piece_price')) return totalprice["total_price"] here is my views.py from __future__ import unicode_literals from django.http import HttpResponse from .models import * import json from django.http import JsonResponse, HttpResponse from .serializers import * from rest_framework.views import APIView from rest_framework.response import Response from rest_framework import status from rest_framework import viewsets, generics from rest_framework.decorators import api_view @api_view(['GET', 'POST']) def CatalogView(request): if request.method == 'GET': catalogs = Catalog.objects.select_related('company_name') serializer = CatalogSerializer(catalogs, many=True) return Response(serializer.data) elif request.method == 'POST': serializer = CatalogSerializerPost(data=request.data) if serializer.is_valid(): … -
Pass JS list/dict to Django Template variable to parse and render in modal
So I have a list of key value pairs (dictionary inside of a list) in a JavaScript variable I created in my base.html. Each key represents an item and each value represents a batch, so a one to many relationship using a foreign key in my models.py. My goal is to when I click on my modal, which happens to be a shopping cart, that I'll be able to somehow parse this list like I would the context dictionary inside a Django View using template tags to render as many items that are in the dictionary as there are keys. Is there a way to do this? Let me know if you need to see any of my code. Thank you. -
How we can implement google sign-in registration in saleor django framework?
I tried to implement it where i inserted my google client id key and my gmail password there at fields key and password located at saleor dashboard>configuration>site settings> authorization key>google auth2.0. my result:- i get error400:- redirect uri mismatch . -
My django create user and profile signal doesn't work
#from signals.py from django.db.models.signals import post_save from django.dispatch import receiver from .models import User, Profile @receiver(post_save, sender=User) def create_profile(sender, instance, created, **kwargs): if created: Profile.objects.create(user=instance) @receiver(post_save, sender=User) def save_profile(sender, instance, **kwargs): instance.profile.save() #from models.py from django.db import models from django.utils import timezone from django.contrib.auth.models import AbstractUser from PIL import Image class User(AbstractUser): is_paying_customer = models.BooleanField(default=False) created_at = models.DateTimeField(editable=False) updated_at = models.DateTimeField() def __str__(self): return self.email def save(self, *args, **kwargs): if not self.id: self.created_at = timezone.now() self.updated_at = timezone.now() return super(User, self).save(*args, **kwargs) class Profile(models.Model): user = models.OneToOneField(User, on_delete=models.CASCADE) phone_number = models.CharField(max_length=255, blank=True) address = models.CharField(max_length=255, blank=True) city = models.CharField(max_length=255, blank=True) country = models.CharField(max_length=255, blank=True) linked_in = models.CharField(max_length=255, blank=True) objective = models.TextField(blank=True) profile_pic = models.ImageField(default="profile-pics/default.jpg/", upload_to="profile-pics") def __str__(self): return self.user.email def save(self): super().save() img = Image.open(self.profile_pic.path) if img.height > 300 or img.width > 300: output_size = (100, 100) img.thumbnail(output_size) img.save(self.profile_pic.path) #from apps.py from django.apps import AppConfig class UsersConfig(AppConfig): name = 'users' def ready(self): import users.signals When I create users from Django admin but the profiles never get created with my users. I have included code from various files in my Django project. I believe I have the correct code but maybe a fresh set of eyes will help. What am I … -
How to unbind the foreign key related relationship?
How to delete the foreign key? I have two models: class Child(models.Model): name = models.CharField(max_length=256, null=True, blank=True) parent = models.ForeignKey(to=Parent, null=True, related_name="children", on_delete=models.DO_NOTHING) class Parent(models.Model): name = models.CharField(max_length=256, null=True, blank=True) def unbind_child(self): # how to realize this? I want to unbind the child, I means I want to make the special Parent related Child instance's parent field to be None. -
Plotting Barcharts and Piecharts in django graphos
I am totally new to Django and Django Graphos. I want to draw a number of graphs using graphos. I could only draw a line chart using graphos. data = [ ['Year', 'Sales', 'Expenses'], [2004, 1000, 400], [2005, 1170, 460], [2006, 660, 1120], [2007, 1030, 540] ] # DataSource object data_source = SimpleDataSource(data=data) # Chart object linechart = LineChart(data_source) context = {'lchart': linechart} return render(request, 'Administrators/analysis_dashboard.html', context=context) Can anyone suggest how to draw bargraphs and pie charts using graphos? -
create new parent model in CreateView in django
i am new to django and to this site, so apologies if this has been solved before but i haven't found it So i have 2 django models ModelA(Model): ModelB(Model): modelA = ForeignKey(ModelA, on_delete=models.CASCADE) A form for the ModelB ModelBForm(ModelForm): class Meta: model=ModelB exclude=() and a view createModelBView(CreateView): model = ModelB form_class = ModelBForm the template only does {{form}} When rendered, there is a dropdown list for the ModelA field so I can choose from existing instances of the ModelA, but what if a new one needs to be created? In the admin there is an option next to edit or create a new ModelA in a popup. Is there an option to do this with CreateView? Thanks -
Calculating distance between two PointField (s) - Why is my result incorrect?
I am trying to calculate the distance between two locations in miles however the result that I am getting is incorrect. The reason I think its incorrect is because I put locations (latitude and longitude) on this website and I get the distance in miles as 0.055. Here are the details from my code PointField A : (-122.1772784, 47.7001663) PointField B : (-122.1761632, 47.700408) Distance : 0.001141091551967795 However according to the website the distance should be Distance : 0.055 miles Here is how I am calculating the distance. This is my model class modelEmp(models.Model): user = models.ForeignKey(User, on_delete=models.CASCADE, null=True, blank=True) location = models.PointField(srid=4326,max_length=40, blank=True, null=True) objects = GeoManager() and this is how I calculate the distance result = modelEmpInstance.location.distance(PointFieldBLocation) where result = 0.001141091551967795 Any suggestions on what I might be doing wrong here and why my result is different from the website ? -
Django Admin page won't let me delete or add users/group. urls error
I am new to Django. I just set up my own Django server but I am having trouble with the admin page. When I try adding or deleting users or basically whenever I send POST request from Django admin page, I am getting the following error: Raised by: django.contrib.admin.options.changelist_view Using the URLconf defined in mysite.urls, Django tried these URL patterns, in this order: ^admin/ ^register/$ [name='register'] ^$ ^login/$ [name='login'] ^static\/(?P<path>.*)$ The current path, auth/user/, didn't match any of these. I tried doing python manage.py migrate but there are no migrations to apply. I am guessing this has to do with urls.py or settings.py files. re_path('^admin/', admin.site.urls) url pattern is already there, I am not sure why it is still giving the error. This is my urls.py file: from django.urls import re_path from django.contrib import admin from django.conf import settings from django.conf.urls.static import static admin.autodiscover() urlpatterns = [ re_path('^admin/', admin.site.urls), re_path('^register/$', register_page, name='register'), re_path('^$', home_page), re_path('^login/$', login_page, name='login'), ] + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT) And this is settings.py import os BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) SECRET_KEY = 'key' DEBUG = True ALLOWED_HOSTS = ['myip'] # Application definition INSTALLED_APPS = [ 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'mysite', ] MIDDLEWARE = [ 'django.middleware.security.SecurityMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', … -
Creating a separate border for each comment Django Css
I am having trouble finding a way to create a separate border box for each comment that is made similar to below. However when I add a new comment the border doubles similar to below I am currently using Django/python here is my html file <div class="comments--section "> {% for comment in comments %} <div class="comments--border"> <p class="comments--user">{{comment.user }}</p> <p class="comments--date">{{comment.date_added|date:'M d, Y' }}</p> <p class="comments--entry">{{ comment }}</p> {% if request.user.is_superuser %} <p> <a href="{% url 'blogging_logs:delete_comment' comment.id %}">Delete comment</a> </p> {% else %} {% if comment.user == request.user %} <p> <a href="{% url 'blogging_logs:delete_comment' comment.id %}" class="comments--delete">Delete comment</a> </p> </div> {% else %} {% endif %} {% endif %} {% empty %} <p>no comments entered yet.</p> {% endfor %} </div> css file: &--section { width: 600px; margin-left: auto; margin-right: auto; margin-top: 2rem; margin-bottom: 2 } &--border { border-style: solid; border-width: 1px; margin-bottom: 2rem; } &--user { font-size: 1.125rem; font-weight: 500; margin-bottom: 0; } &--date { font-size: .7rem; font-weight: 300; } &--entry { font-weight: 300; font-size: 1rem; } I know the reason my border is doubling however I don't know how to get around it. If I move the div class outside of the loop it creates one large box … -
How to copy (mouse click--> copy) models drop down field in admin change/edit page
As you can see in the picture of admin edit page for a model, i have the the field Team. But i can not copy it using mouse or ctrl+c command. The model is simple: class Device(models.Model): ... ... team= models.ForeignKey("Team",on_delete=models.CASCADE) ... How can i enable copy option for these drop fields i have? -
Password becoming unhashed even after saving to database
I have a generic APIView where I'm overriding the create method. This is for the Group model, where I've added a password field: def create(self, request, *args, **kwargs): data = request.data data['password'] = make_password(data['password']) serializer = self.get_serializer(data=data) serializer.is_valid(raise_exception=True) self.perform_create(serializer) headers = self.get_success_headers(serializer.data) # debug code print(Group.objects.get(name=data['name']).__dict__) # shows hashed password print(serializer.data) # shows hashed password return Response(serializer.data, status=status.HTTP_201_CREATED, headers=headers) But when I query this model after leaving the create method: print(Group.objects.get(name='TestGroup').__dict__) # shows raw password Inexplicably, after checking both the serializer.data and querying the database directly in the above print statements, I confirm that I have passed a hashed password into the column. However, whenever I query this afterwards, I see that the raw password has been saved. I cannot explain how the password is becoming unhashed after saving the hashed password to the database. I am not writing to the Group model anywhere else. -
Dynamic Instance Specific Django Field Creation
I have a situation where a User model can have 'X' number of unique fields that need to be added. These fields need to have queries run on them, so I cant just add a field containing a string of JSON to it. For example, one user could look like: class User(models.Model): name = models.CharField() age = models.IntegerField() sex = models.CharField() profession = models.CharField() And the next could be: class User(models.Model): name = models.CharField() age = models.IntegerField() sex = models.CharField() badge_number = models.IntegerField() Like I said above, these unique fields must be queryable. HELP!! -
Robo selenium with django
I need help to integrate a web system webpage (Django) a robot in Selenium python, let's: I developed some thefts in python + selenium that make access to our web systems to get results, now I need to put this web .. and I have no idea how to join the WEB (Django) interface with scrip_selenium.py Screen of web page People will access this page and fill in the zip CODE and the NUMBER and the form should send to the selenium script that will access my system fetch the information and return to the web the result of the query. I'm not a programmer, so I can not do these things .. I'm B.I but I need to do this Part of code selenium: def preenche_campos(self, wait): campo_code_form = **I don't know how to do this, get field to form to do here** campo_cep = self.driver.find_element_by_name("formTemplate:j_id28") campo_cep.send_keys(campo_code_form) campo_cep.send_keys(Keys.TAB) time.sleep(1) campo_nr = self.driver.find_element_by_id("formTemplate:unitNumber") **the value of the variable number must come to that field** campo_nr_site = '**I don't know how to do this, get field to form to do here**' campo_nr.send_keys('58') time.sleep(1) # Clica no campo Pesquisar pesquisar = wait.until(EC.element_to_be_clickable((By.ID, 'formTemplate:findAddressbtnPesquisar'))) pesquisar.click() wait.until(EC.invisibility_of_element_located((By.ID, 'formTemplate:popuprogressContentTable'))) Clicking on search to trigger the … -
Disabling mod_expires in apache2 stopped server from serving static files
I tried to use browser caching with apache2 mod_expires but I had a problem that after updating some files, the browser still shows the outdated ones. So I wanted to undo the process and removed the mod_expires code from .conf file. The website is not serving images any more! It shows that "was not found on this server." although all I did was to remove the added code from configuration file and restart apache! I'm using the config file located at: /etc/apache2/sites-available/000-default.conf I tried to restart the virtual machine (I'm using Google Compute Engine). I tried to a2dismod mod_expires too. But nothing worked! Even if I tried to re-upload images! What is the problem and how can I get my website to serve back static files? Here is the added and the removed code: <IfModule mod_expires.c> ExpiresActive on ExpiresByType image/jpg "access plus 60 days" ExpiresByType image/png "access plus 60 days" ExpiresByType image/gif "access plus 60 days" ExpiresByType image/jpeg "access plus 60 days" ExpiresByType text/css "access plus 60 days" ExpiresByType image/x-icon "access plus 1 month" ExpiresByType application/pdf "access plus 1 month" ExpiresByType audio/x-wav "access plus 1 month" ExpiresByType audio/mpeg "access plus 1 month" ExpiresByType video/mpeg "access plus 1 month" ExpiresByType video/mp4 … -
Problem with drf-knox and dr-auth registration
I am learning drf and I was trying to use knox with django-rest-auth. The login works fine, but I have a problem with the registration part. When I call the api to add a new user with localhost:8000/rest-auth/registration, I fill the form but then it returns AttributeError at /rest-auth/registration/ type object 'Token' has no attribute 'objects' And I don't know why:/ This is my settings.py file: INSTALLED_APPS = [ 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'rest_framework', 'rest_auth', 'django.contrib.sites', 'allauth', 'allauth.account', 'rest_auth.registration', 'knox', ] REST_FRAMEWORK = { 'DEFAULT_AUTHENTICATION_CLASSES': ('knox.auth.TokenAuthentication',), } SITE_ID = 1 And this is my urls.py file: from django.contrib import admin from django.urls import path, include urlpatterns = [ path('admin/', admin.site.urls), path('rest-auth/', include('rest_auth.urls')), path('rest-auth/registration/', include('rest_auth.registration.urls')), ] Where is the mistake ? What can I do to fix it ? Thank you for your help ;D -
Multiple Login in same django project
I have a django project with 3 apps: CORE, FRONT-A and FRONT-B. So, each APP should have your own login page, something like: http://localhost:8080/front-a/login http://localhost:8080/front-b/login CORE app have Django Admin and Models, that should be used by FRONT-A and FRONT-B app, like a shared "jar" in java. But some login properties i have to configure in settings.xml, like this: LOGIN_URL = 'login' LOGOUT_URL = 'logout' LOGIN_REDIRECT_URL = 'FRONT-A OR FRONT-B ?' So, i have some doubts: In my case is better create one project for FRONT-A and another for FRONT-B, because i need different login pages ? If answer for (1) is NO, how can i create a login page for each APP, and grant session for each APP ? If answer for (1) is YES, can i use CORE App as shared library to my another projects ? I want to avoid "duplicate code". How can i know if i need APP onyl or create another whole PROJECT ? -
Django-2.0 How to remove an App and delete all its associated database tables
I have installed a Django app and not I want to delete it completely. It has created some tables in the database too. I want an neat and clean way of removing the app with all its database tables. -
How to create unique download links for protected files that aren't from static? (django)
Overview: Hi, I made an app that takes a persons email and some other fields to construct a unique url, such as example.com/signup/confirmed/5/uygduif-78q6rjhsadkfe-IUWGIasdy756/2597646/. I'm trying to make it so this url can allow the user to download a pdf, FROM THIS URL, and not a different href location, but I can't figure it out. The point is to make it a protected file. I know I can force a user to login and stuff, but this is a pdf they get just for signing up, so account creation isn't necessary. What I tried / some thoughts: My first attempt was {% load static %} in my template, and add the href to download it in there. That allows me to open the pdf and save it, but the url for that is example.com/static/pdfs/some.pdf, which is bad, because anyone who knows html can copy/paste that location, paste it for everyone else, and now I don't get anybody's emails, but everybody gets a download. I also made another app where users can upload images to the database, then I can loop through them all afterward, but the src attribute in those <img> tag's are all at media/some_random_img_name.jpg. So using that example won't … -
Django and MongoDB saving EmbeddedDocumentField
I am using Django 2.1.1 and mongoengine. I am trying save some data to the mongoDB database. I keep receiving an error and I am not sure where I messed up. I was using this questions as a reference to help out. The error im receiving is ValidationError (Block:None) (Only dictionaries may be used in a DictField: ['details']) Model from mongoengine import * class Emb1(EmbeddedDocument): item1 = StringField(max_length=200, required=True) item2 = StringField(required=True) email = EmailField(required=True) class Emb2(EmbeddedDocument): item1 = StringField(max_length=12, required=True) class Block(Document): type = StringField(max_length=10, required=True) details = MapField(EmbeddedDocumentField(Emb2, default=Emb2)) next_block = IntField(required=True) View class TestView(LoginRequiredMixin,DetailView): template_name = 'test/test.html' def get(self, request, *args, **kwargs): mongoConnect('test_db') block= Block() emb1= Emb1() emb1.item1 = 'Test message 1' emb1.item2 = 'Test message 2' emb1.email = 'test@gmail.com' block.type = 'test' block.details = emb1 block.next_block = 1 block.save() return HttpResponse("SAVED") -
Delete Event from FullCalendar and also Django
Looking for a bit of direction after struggling to find anything googling.. I have implemented full calendar.io using django to store the events. I can show the events and when the events are clicked, they open a modal, showing the data for that event. In this modal, I want to include a delete button, I can pass the id of the event from django to the modal but I cannot figure out how to delete the entry from the django dB when the delete button is clicked.. Can someone please help? Any direction would be appreciated! -
aws eb deployment error : No matching distribution found for anaconda-client==1.6.9
I am very new to aws and in-general coding. I wrote a small django application and now I am trying to deploy it on aws using elastic beanstalk with the help of this URL. https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create-deploy-python-django.html My application uses postgres database for which I need psycopg2 package. which I have added in my requirements.txt file. (this is not part of the instructions on this URL but I knew I need psycopg2 so I added) when I create eb environment using "eb create django-env", I get the following error:(this log is taken from ec2 /var/log/) [2018-09-26T21:44:20.502Z] INFO [3151] - [Application deployment app-d840-180926_224155@1/StartupStage0/AppDeployPreHo ok/03deploy.py] : Starting activity... [2018-09-26T21:44:21.774Z] INFO [3151] - [Application deployment app-d840-180926_224155@1/StartupStage0/AppDeployPreHo ok/03deploy.py] : Activity execution failed, because: Collecting alabaster==0.7.10 (from -r /opt/python/ondeck/app/requi rements.txt (line 1)) Downloading https://files.pythonhosted.org/packages/2e/c3/9b7dcd8548cf2c00531763ba154e524af575e8f36701bacfe5bcadc674 40/alabaster-0.7.10-py2.py3-none-any.whl Collecting anaconda-client==1.6.9 (from -r /opt/python/ondeck/app/requirements.txt (line 2)) Could not find a version that satisfies the requirement anaconda-client==1.6.9 (from -r /opt/python/ondeck/app/requi rements.txt (line 2)) (from versions: 1.1.1, 1.2.2) No matching distribution found for anaconda-client==1.6.9 (from -r /opt/python/ondeck/app/requirements.txt (line 2)) You are using pip version 9.0.1, however version 18.0 is available. You should consider upgrading via the 'pip install --upgrade pip' command. 2018-09-26 21:44:21,768 ERROR Error installing dependencies: Command '/opt/python/run/venv/bin/pip install -r /opt/ python/ondeck/app/requirements.txt' … -
Web Framework for text based simulation "games"
My intent is to build a text based simulation game, where you more or less only manipulate the database all the time (at least i assume that's how simulation games work) and where calculations take place in the background at specific times of the day. (for example for calculating games if it was a football manager, etc.) I really tried to read all content available for what web application technology is the best for my needs, but i am still not really sure and don't want to spend hours learning a technology which is not really best suited. Spring seems to be decent, however it has a pretty steep learning curve and i wonder if it would be a little "overkill" for that. Would Spark be an alternative? I like Java. Ruby on Rails also looked quite good, however i didn't really like the syntax of Ruby and the way you get boilerplates for almost all things. It was a little overwhelming at first. How about NodeJS, is it suitable for that kind of application? I did not mention all frameworks here, i would still be very happy if you can give me pro or cons for what tech could …