Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
Server Error 500 when uploading image
I am trying to solve a problem with uploading images. I have set the error.log for Nginx to info. First when I'm trying to upload, I get 413 Request Entity Too Large. In error.log it says client intended to send too large body: 2524917 bytes, client: my.client.public.ip, server: my.server.public.ip, request: "POST /admin/part/part/7/change/ HTTP/1.1", host: "my.domain.se", referrer: "http://my.domain.se/admin/part/part/7/change/" So I add this line in my config for Nginx client_max_body_size 50M; and restart Nginx. When trying to upload again I get Server Error (500) with this line in error.log a client request body is buffered to a temporary file /var/lib/nginx/body/0000000001, client: my.client.public.ip, server: my.server.public.ip, request: "POST /admin/part/part/7/change/ HTTP/1.1", host: "my.domain.se", referrer: "http://my.domain.se/admin/part/part/7/change/" Can't seem to find any answer when searching the internets. -
Method in Thread stop my UI - Python Django
I am trying to run some periodic (scheduler) method asynchronously, so that UI thread is not blocked. My current code is: class Job(): def run(self): thread = threading.Thread(target=self.run_inside_thread, args=[]) thread.setDaemon(True) thread.start() def run_inside_thread(self): schedule.every(self.tick).seconds.do(self.call_method) while True: if self.isRunning: schedule.run_pending() I use if self.isRunning:, so that I can stop and start the tasks. The problem is that this is blocking my UI (but only on server - on my local development machine UI is working) What I am doing wrong? By my understanding code should run async on another thread (not UI one). I see the "fix" that you put time.sleep(1), but this mean that I can't run method sunner then 1 second. If for example I do time.sleep(0.1) it doesn't work. (UI thread is blocked) -
test value in template
When i would like to test value in my template, i have the error: Could not parse the remainder '=="0" How can i test a value in template? {%for eb in ebau %} <tr class="ligne-{{forloop.counter}}"> <td id="cb-{{forloop.counter}}" class="cbox" > {% if eb.0=="0" %} <input type="checkbox" class="cb-{{forloop.counter}} " id="id-{{forloop.counter}}" checked="checked"/> {% else %} <input type="checkbox" class="cb-{{forloop.counter}} " id="id-{{forloop.counter}}" checked="checked"/> {% endif %} </td> <td class="case">{{eb.0}}</td> <td class="case">{{eb.2}}</td> <td class="case">{{eb.3}}</td> <td class="case">{{eb.4}}</td> </tr> {% endfor %} Thanks. -
in navicat for mysql, i'm try delete goods_goods table, but get error: cannot delete or update parent row: a foreign key constaint fails?
in my navicat for mysql, my 'goods_goods' table data repeat once, and i try to delete about 'goods' table, but when delete goods_goods table , i get error: cannot delete or update parent row: a foreign key constaint fails? apps/goods/models.py class Goods(models.Model): """ category = models.ForeignKey(GoodsCategory, verbose_name="商品类目") goods_sn = models.CharField(max_length=50, default="", verbose_name="商品唯一货号") name = models.CharField(max_length=100, verbose_name="商品名") click_num = models.IntegerField(default=0, verbose_name="点击数") sold_num = models.IntegerField(default=0, verbose_name="商品销售量") fav_num = models.IntegerField(default=0, verbose_name="收藏数") goods_num = models.IntegerField(default=0, verbose_name="库存数") market_price = models.FloatField(default=0, verbose_name="市场价格") shop_price = models.FloatField(default=0, verbose_name="本店价格") goods_brief = models.TextField(max_length=500, verbose_name="商品简短描述") goods_desc = UEditorField(verbose_name=u"内容", imagePath="goods/images/", width=1000, height=300, filePath="goods/files/", default='') ship_free = models.BooleanField(default=True, verbose_name="是否承担运费") goods_front_image = models.ImageField(upload_to="goods/images/", null=True, blank=True, verbose_name="封面图") is_new = models.BooleanField(default=False, verbose_name="是否新品") is_hot = models.BooleanField(default=False, verbose_name="是否热销") add_time = models.DateTimeField(default=datetime.now, verbose_name="添加时间") class Meta: verbose_name = '商品' verbose_name_plural = verbose_name def __str__(self): return self.name i want to delete about 'goods' data table, use 'makemigrations and mkgrate' regenerate about 'goods' data table, how to resolve this error, and delete 'goods_goods and goods_goodscategory'?thanks! -
Can't receive ipn signal from PayPal
I am try to receive ipn signal from PayPal after transaction, but for someone reason i can't get it. This is my form (I send to paypal using simple form html): <form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post" id="checkout_form_id"> <input type="hidden" name="business" value="mygmail@gmail.com" id="id_business"/> <input type="hidden" name="amount" value="" id="id_amount"/> <input type="hidden" name="item_name" value="Payment for victorywow.com" id="id_item_name"/> <input type="hidden" name="notify_url" value="{{ paypal_url }}/paypal/" id="id_notify_url"/> <input type="hidden" name="cancel_return" value={{ paypal_url }}?cancel_return= id="id_cancel_return"/> <input id="id_return_url" name="return" type="hidden" value="{{ paypal_url }}?success_return="/> <input type="hidden" name="invoice" value="" id="id_invoice"/> <input type="hidden" name="cmd" value="_xclick" id="id_cmd"/> <input type="hidden" name="charset" value="utf-8" id="id_charset"/> <input type="hidden" name="currency_code" value="USD" id="id_currency_code"/> <input type="hidden" name="no_shipping" value="1" id="id_no_shipping" /> <input type="button" class="form_button pay_pal_but" value="PAY NOW"> </form> Some variable such invoice_id,amount and so on I add by js. 'paypal_url' I create in views.py : request.build_absolute_uri(reverse('index')) (index is url like this'^$') urls.py: url(r'^paypal/', include('paypal.standard.ipn.urls')) signals.py: from paypal.standard.models import ST_PP_COMPLETED from paypal.standard.ipn.signals import valid_ipn_received from .models import Order def ipn_geter(sender, **kwargs): print(1000 * '*') ipn_obj = sender print(ipn_obj.receiver_email) order = Order.objects.get(id=28) order.email = ipn_obj.receiver_email order.save() if ipn_obj.payment_status == ST_PP_COMPLETED: pass valid_ipn_received.connect(ipn_geter) But after success paypal transaction ipn_geter does not execute. What should I do to fix it. Why i don't get ipn signals? -
Could I filter out the field which is not meet the condition?
I have a model, and it has a is_tracked field: class Track3(models.Model): track = models.ForeignKey(Track, related_name='track3s', on_delete=models.CASCADE) order = models.IntegerField() title = models.CharField(max_length=100) duration = models.IntegerField() is_tracked = models.BooleanField(default=True) When I create the Serializer of it: class Track3Serializer(serializers.ModelSerializer): class Meta: model = models.Track3 fields = ('order', 'title', 'duration') When I get the Track3Serializer instance, it will get all the Track3s. May I ask a question, could I filter out the is_tracked=False? how to do with that? -
Postman gets csrf cookie from django api but I get Forbidden 403 - CSRF token missing or incorrect
I'm using django rest-framework api for user registration. This my curl command is: curl -i -H 'Accept: application/json; indent=4' -H 'referer:https://domain' -X POST https://domain/users/:register/ -d "id=222111&firstname=zinonas&yearofbirth=2007&lastname=Antoniou&othernames=" When I try it from cygwin is working properly. This is the output: HTTP/1.1 200 OK Date: Thu, 26 Oct 2017 08:35:40 GMT Server: Apache/2.4.18 (Ubuntu) Allow: POST, OPTIONS Referer: https://domain/ Content-Length: 188 X-Frame-Options: SAMEORIGIN Vary: Accept,Cookie X-CSRFToken: MLJKNmBdYdF02ANX7pvZ7UavOVXtuPdW34vcF0RuLy94c1mQrL6blzkLMHCAFYkP Set-Cookie: csrftoken=sFkh2JjHxma3qnGpcRiOkQmH0xs9txqIJY6JUnzYkHE7AOfiwdT0yvwXYj7gEGxB; expires=Thu, 25-Oct-2018 08:35:40 GMT; Max-Age=31449600; Path=/ Content-Type: application/json { "isnew": "false", "user": { "firstname": "zinonas", "id": "222111", "lastnames": "Antoniou", "yearofbirth": 2007, "othernames": "" } } When I try the curl command in postman I get forbidden 403 error - CSRF token missing or incorrect. I have enabled postman interceptop and I set Referer header equal to https://domain. However I get the csrf cookie as can be seen in the image below: -
Structured data in Django
Django 1.11.6 Could you tell me what is the Django way of implementing structured data. I have an information site. And I may need any type of structured data: either present or appearing in future. I mean this: https://developers.google.com/search/docs/guides/intro-structured-data I append articles through admin only. In other words users don't generate articles, they just comment. Structured data may be a big insertion to a page. Even in the above linked page an example is trimmed for brevity. And there may be more content types in future. So, maybe it is not reasonable to burden models with such information. I can only think of a safe template tag. In the middle of articles structured data will be inserted, say, as a JSON-LD structured data. Could you tell me what are best practices here. -
Custom analyzer with edgeNgram filter doesn't work
I needed partial search in my website.Initially I used edgeNgramFeild directly it didn't work as expected.So I used custom search engine with custom analyzers.I am using Django-haystack. 'settings': { "analysis": { "analyzer": { "ngram_analyzer": { "type": "custom", "tokenizer": "lowercase", "filter": ["haystack_ngram"] }, "edgengram_analyzer": { "type": "custom", "tokenizer": "lowercase", "filter": ["haystack_edgengram"] }, "suggest_analyzer": { "type":"custom", "tokenizer":"standard", "filter":[ "standard", "lowercase", "asciifolding" ] }, }, "tokenizer": { "haystack_ngram_tokenizer": { "type": "nGram", "min_gram": 3, "max_gram": 15, }, "haystack_edgengram_tokenizer": { "type": "edgeNGram", "min_gram": 2, "max_gram": 15, "side": "front" } }, "filter": { "haystack_ngram": { "type": "nGram", "min_gram": 3, "max_gram": 15 }, "haystack_edgengram": { "type": "edgeNGram", "min_gram": 2, "max_gram": 15 } } } } Used edgengram_analyzer for indexing and suggest_analyzer for search. This worked for some extent.But,it doesn't work for numbers for example when 30 is entered it doesn't search for 303 and also with words containing alphabet and numbers combined. so I searched for various sites. They suggestsed to use standard or whitespace tokenizer and with haystack_edgengram filter.But it didn't work at all,puting aside number partial search didn't work even for alphabet.The settings after the suggestion: 'settings': { "analysis": { "analyzer": { "ngram_analyzer": { "type": "custom", "tokenizer": "lowercase", "filter": ["haystack_ngram"] }, "edgengram_analyzer": { "type": "custom", … -
Webpage is scrollable when i want it to be a fixed size - django
I am working on django template and I am integrating bootstrap into the html tempates for the project. Every template page is scrollable even though the content does not fill the page. I want all the webpages to be unscollable and set the default heigh of the div that contains to the content to be 100 percent of the screen. I baiscally want to eliminate the scrollablility of the page and set the fixed high to the size of the window that is open. Can anyone help me. Here is the webpage and the custom css that I added to the bootstrap columns: <div class="col content-max-height"> {% block content %} {% endblock %} </div> {% extends "header.html" %} {% block content %} <h2 class="page-header">{{ group.group.name }}</h2> <div class="scrollable-view"> {% for activity in activities %} {% if activity.user == currentUser %} {% if activity.general == 2 %} <p>{{ activity.description }}</p> {% endif %} {% endif %} {% if activity.user != currentUser %} {% if activity.general == 1 %} <p>{{ activity.description }}</p> {% endif %} {% endif %} {% endfor %} </div> {% if currentUser == host.user %} <a href="{% url 'add_expense' host.group.id %}">Add New Expense</a> {% endif %} {% endblock %} … -
Having hard time deploying Django + PostGis on AWS Beanstalk (DatabaseOperations error)
I’m having troubles making Django + PostGIS work on AWS BeanStalk. The app runs, some parts of the app work properly, but when trying to access object with GeoDjango fields (PointField) I get this error: Attribute Error 'DatabaseOperations' object has no attribute 'select' /opt/python/run/venv/lib/python3.4/site-packages/django/contrib/gis/db/models/fields.py in select_format, line 61 I have googled this error, and very few people encountered it. The closest error I could find is: Getting 'DatabaseOperations' object has no attribute 'geo_db_type' error when doing a syncdb But my databases is configured correctly in the Django Settings Module as follows: DATABASES = { 'default': { 'ENGINE': 'django.contrib.gis.db.backends.postgis', 'NAME': os.environ['RDS_DB_NAME'], 'USER': os.environ['RDS_USERNAME'], 'PASSWORD': os.environ['RDS_PASSWORD'], 'HOST': os.environ['RDS_HOSTNAME'], 'PORT': os.environ['RDS_PORT'], } } I’m using Django 1.9.5 with PostGis 2.3.0 and PostgreSQL 9.5.2 I’m using a custom AMI based on 2017.03 that I made using this script: https://gist.github.com/nitrag/932ecd7d109f9d1e3ed378353e0d5c2f PostGis is installing properly on the EC2 instance, I even tried another script and got the same final error. (http://www.daveoncode.com/2014/02/18/creating-custom-ami-with-postgis-and-its-dependencies-to-deploy-django-geodjango-amazon-elastic-beanstalk/) I am really on my last legs here, any help will be greatly appreciated! -
django filter list tag__in with "and" operator
I have a list for tags [11,12,13 14] When I try to filter my items using tag Model.objects.filter(title__contains=title,tag__in=[11,12],listType=listtype,status=1).all() Its showing both item having tag 11 and 12. Than means, it was taking "OR" operation. How can I get the Item list contain both tags 11 and 12. anyone please help -
Refresh values of Django app in Docker (Cloudron)
So I have some Python knowledge, but am a complete beginner with Django and Docker. My problem is the following: I packaged a very basic Django app into a Docker app (actually a Cloudron app, Cloudron is a solution based on Docker). The app is now running on my server (eth.ncollig.net). It's purpose is to give me the price of Ether. But the view.py script ran at the startup of the app on the server, the value of the variable, the price of ether in euros, has been set to 251.7, and it is never refreshed. I would like the value of this variable to be recalculated at every new page load. What should I do to achieve this? Thanks in advance for any help. Here's my views.py: from django.http import HttpResponse from coinbase.wallet.client import Client client = Client('yhKYHa8AkQaHXDMc','quspNs86vAvsRtyuGmE3nC5o9Nki2pqP') rates = client.get_exchange_rates(currency='ETH') eth_rate = rates['rates']['EUR'] def index(request): return HttpResponse("1 ETH = %s EUR" % eth_rate) Here's my start.sh, used to launch the gunicorn server: #!/bin/bash # Start Gunicorn processes echo Starting Gunicorn. exec gunicorn ethprice.wsgi:application \ --bind 0.0.0.0:8000 \ --workers 3 The Dockerfile: FROM cloudron/base:0.11.0 MAINTAINER Authors name <support@cloudron.io> RUN mkdir -p /app/code WORKDIR /app/code COPY ethprice /app/code/ COPY start.sh … -
AttributeError - When using Django NestedFields serializers
I've 2 models:- class Users(models.Model): first_name = models.CharField(max_length=255) middle_name = models.CharField(max_length=255) class UserAddress(models.Model): line1 = models.CharField(max_length=255) country = models.CharField(max_length=255) user = models.ForeignKey(Users) The user model & user address model. Following are the 2 serializers. class UserAddressSerializer(ModelSerializer): class Meta: model = UserAddress exclude = ('id', 'user') class UserSerializer(ModelSerializer): address = UserAddressSerializer(many=True) class Meta: model = Users fields = '__all__' def create(self, validated_data): address = validated_data.pop('address', []) user = Users.objects.create(**validated_data) for ad in address: UserAddress.objects.create(user=user, **ad) return user The data I receive from the client is { "first_name": "string", "last_name": "string", "address": [{ "line1": "asd", "country": "asd", }], } This is how I create a new user and its corresponding address. class UserCreate(GenericAPIView): serializer_class = UserSerializer def post(self, request, *args, **kwargs): data = request.data serializer = UserSerializer(data=data) if not serializer.is_valid(): return user = serializer.save() response = { 'user_id': user.uuid } return Now, upon getting the user details back, I receive an error saying AttributeError: Got AttributeError when attempting to get a value for field `address` on serializer `UserSerializer`. The serializer field might be named incorrectly and not match any attribute or key on the `Users` instance. Original exception text was: 'Users' object has no attribute 'address'. This is how I get the … -
Django rest-api: Postman can't see CSRF token
I'm using django 1.11.6 and python 3.5 on an ubuntu server. I have an api for user registration. This is my curlcommand: curl -i -H 'Accept: application/json; indent=4' -X POST https://mydomain/users/:register/ -d "id=222111&firstname=andy&yearofbirth=2007&lastname=Chris&othernames=" When I use it in cygwin I get this response which is the desired: HTTP/1.1 200 OK Date: Thu, 26 Oct 2017 06:41:00 GMT Server: Apache/2.4.18 (Ubuntu) Allow: POST, OPTIONS Vary: Accept,Cookie Content-Length: 188 X-CSRFToken: acY2oPGkkqkzBe9itBq56oFeTFAllqv2bS39c7TpPN9LlGh90E1FxsI0YXLlu1Vu X-Frame-Options: SAMEORIGIN Set-Cookie: csrftoken=QfxnUGTmrRi1MThcn8Qau5ytnt2NR8tdRVCuIY6rWe7dwlp3UbrKV9BfsLdN0JTF; expires=Thu, 25-Oct-2018 06:41:01 GMT; Max-Age=31449600; Path=/ Content-Type: application/json { "isnew": "true", "user": { "othernames": "", "id": "222111", "firstname": "Andy", "yearofbirth": 2007, "lastnames": "Chris" } } As I can see, I have X-CSRFToken header and `csrftoken' cookie. When I try to run the same curl command from postman I get: Forbidden (403) CSRF verification failed. Request aborted. You are seeing this message because this HTTPS site requires a 'Referer header' to be sent by your Web browser, but none was sent. This header is required for security reasons, to ensure that your browser is not being hijacked by third parties. If you have configured your browser to disable 'Referer' headers, please re-enable them, at least for this site, or for HTTPS connections, or for 'same-origin' requests. My function … -
Django elastic search filter Aggregations
I have two filters in my django elastic search... search = search.filter("term", status=Status.ACTIVE) search = search.filter("term", organization__pk=self.request.user.organization.pk) How can I aggregate them ? -
Django Query Regex for filtering data
I have a Category model class Category(models.Model): title = models.CharField(_('title'), max_length=200, blank=False) qs = Category.objects.all() Say Title values are Trailer1 Trailer2 ABC Trailer BCD EFG Trailer EFG GEF TED Trailer ..... These values are in random order. And on filtering we would need the data in the above order I want to perform ranking / selection . 1) Starts with search string qs1= qs.filter(title__istartswith= format('trailer')) What's the best way of filtering the results. I can get the output easily in pythonic way. But was trying out with regex and loops. Any suggestions will help. Thanks -
Django- Retrieve all details from mysql database
I have a django application connected to mysql database. In the MySQL database I have a table called Evaluation with eval_id, eval_name and date as its columns. From my django view I am trying to get the releveant data with the below code. from django.http import HttpResponse, JsonResponse from .models import Teacher, Subject, Evaluation, Teaches, eval_summary # Create your views here. def index(request): eval_list = Evaluation.objects.all() return HttpResponse(eval_list) Here in the output I am only getting the eval_name entries and not the eval_id and date. What should I include to get all the details? My output is just 2014_Term1 2014_Term2 2014_Term3 2015_Term1 so on.. I also want the ID and date to be associated with each entry. -
Django+PostgreSql: Can I run out of id/pk?
In my application I am going to need a setup where every user has some derived/calculated information in the database. It should be maximum 100 different data sets with each around 100 rows (100x100) per user. This rows need to be refreshed around every three months. So, let's say with 10000 users, if everybody uses all hundred places that would be 100M rows recreated every 3 months. As far as my knowledge the postgre int field is 2147483647, that is 2100M+. So, am I going to run out of id/pk in around 5 years with this setup? Should I rethink my setup or is there a way around? I am using Python 2.7.6, postgresql server is 9.3 and django 1.8. -
Django forms field not appearing on webpage
Fields I have added in django forms are not visible on webpage. Attached model, view and html for the reference below. This is an additional filed which I intent to add to the forms, I am new to Django and learning by enhancing the current project. Thanks forms.py class ClientProfileForm(forms.ModelForm): class Meta: model = ClientProfile fields = ('full_name', 'short_name', 'account_payable', 'require_job_number', 'currency', 'segment', 'market', 'estimated_headcount', 'is_technicolor', 'address') views.py def client_profile(request): all_profiles = ClientProfile.objects.filter(status='active') profile = None pid = request.GET.get('pid') client_profile_form = ClientProfileForm() if pid: profile = ClientProfile.objects.get(id=pid) client_profile_form = ClientProfileForm(instance=profile) if request.method == 'POST': client_profile_form = ClientProfileForm(request.POST, instance=profile) if client_profile_form.is_valid(): profile = client_profile_form.save() profile.csv_mapping = profile.full_name profile.save() if profile: for task_type in TaskType.objects.all(): if not profile.task_costs.filter(task_type=task_type): task_cost = TaskCost(task_type=task_type) task_cost.save() profile.task_costs.add(task_cost) return render(request, "prod/client_profile.html", {'all_profiles': all_profiles, 'profile': profile, 'client_profile_form': client_profile_form}) **HTML** <div class="content"> <form id='add_new_client_form' method="post" action=""> {% csrf_token %} <table class="table"> <tbody> {{ client_profile_form.as_table }} </tbody> <tfoot> <tr> <td></td> <td> <button class="lock" type="button" onclick="unlock(this, '#add_new_client_form')">Unlock </button> <button type="submit">SAVE</button> </td> </tr> </tfoot> </table> </form> </div> -
Asking permission to post and tag friend using graph API and Django
I have tried an application where I have shared the post with my application output and have tagged friends. The Facebook had blocked me saying that the application is violating the facebook policies. I guess it is because I have not asked person before posting and tagging the friends. Here is the code of what I have tried: def share(request): access_token = SocialToken.objects.get(account__user=request.user, account__provider='facebook') message = request.POST.get('message') params = { "access_token": access_token.token, "fields": "taggable_friends.limit(5){id}" } friends = json.loads(requests.get('https://graph.facebook.com/v2.10/me', params=params).text) friend_id = ','.join([id1['id'] for id1 in friends['taggable_friends']['data']]) # print friend_id params = { "access_token": access_token.token, "message": message, "place": "post", "tags": friend_id } requests.post('https://graph.facebook.com/v2.10/me/feed', params=params) return HttpResponse(json.dumps({'status': 200}), content_type="application/json") I want to know what improvement is required in my code so that it will ask for the permissions and then post on the users wall with tagged friends. Kindly, help me in making improvements to my code. -
Django: Advanced Template Filters
Here's my problem, In view I have, object = Data.objects.all() In template, {% for obj in object %} Here I can print Data... But also I wants to print Game and Extras. Where Game to related to "Data" through foreign key & "Extras" is related to "Game" through foreign key. This is how I'm doing it, {% for abc in obj.game_set.all %} Here I can print ]Games related to Data.. but also I wants to print Extras. this is what i'm doing, {% for var in abc.extras_set.all %} {{ var }} {% endfor %} {% endfor %} {% endfor %} Everything is fine accept the fact that I wants to print out latest 2 games having latest extras. I can use distortreversed & then slice to get latest 2 games but that will simply print out the latest games not will not give the latest games having latest extras. SO, how can I do that? Is there a way to do this in view & then follow with for loop in template? -
django-notes replacement package or reimplement?
I am looking for a replacement for the dated and unmaintained django-notes package. Essentially, I need a way to associate an arbitrarily sized text blob to any Model within my django app. This would be much like the django-tagging or django-taggit apps do, except with one text field instead of many tags. I am fairly new to django and python and my time is limited at the moment. My options are: find an existing and maintained notes application look at existing tagging apps and adapt them to a notes application, using django contenttypes / GenericRelations update the existing app to current django standards Any advice on these options would be much appreciated! -
edxapp : migrate Migration getting failed
I'm struck with below issue from past few and require help very badly. I've installed a Native stack on fresh Ubuntu system in EC2 using https://openedx.atlassian.net/wiki/spaces/OpenOPS/pages/146440579/Native+Open+edX+Ubuntu+16.04+64+bit+Installation. During Installation, every time, installation got failed at [edxapp : migrate] step. I repeated installation many times and one time it worked without any issues. Now I'm trying to activate e commerce service using Native stack using : https://openedx.atlassian.net/wiki/spaces/OpenOPS/pages/110330276/How+to+Install+and+Start+the+E-Commerce+Service+in+Native+Installations , even now, my installation is getting failed at migrate step with below log: failed: [localhost] (item=lms) => {"changed": true, "cmd": ["/edx/bin/edxapp-migrate-lms"], "delta": "0:04:58.188980", "end": "2017-10-26 01:14:15.137864", "failed": true, "item": "lms", "rc": 1, "start": "2017-10-26 01:09:16.948884", "stderr": "2017-10-25 21:09:21,176 INFO 18199 [dd.dogapi] dog_stats_api.py:66 - Initializing dog api to use statsd: localhost, 8125\nTraceback (most recent call last):\n File \"manage.py\", line 116, in <module>\n execute_from_command_line([sys.argv[0]] + django_args)\n File \"/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/core/management/__init__.py\", line 354, in execute_from_command_line\n utility.execute()\n File \"/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/core/management/__init__.py\", line 346, in execute\n self.fetch_command(subcommand).run_from_argv(self.argv)\n File \"/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/core/management/base.py\", line 394, in run_from_argv\n Complete log : https://pastebin.com/1vCTvYg4 Can any help me as I'm struck at this point without a way to proceed. Thanks in advance. -
Django RestAuth Custom password reset link
I have tried the solutions I found for a similar question but none worked for me. I am using an angular frontend + DRF + Django Rest Auth, for the confirmation url, I was able to override it to point to my frontend by adding a custom adapter that looks liked this, class AccountAdapter(DefaultAccountAdapter): def send_mail(self, template_prefix, email, context): context['activate_url'] = settings.URL_FRONT + \ 'access/verify-email/' + context['key'] msg = self.render_mail(template_prefix, email, context) msg.send() with URL_FRONT = 'http://localhost:8080/app/#/' as the setting to direct the user to the client. My problem is implementing the same thing for the password reset url. I want it to start with the URL_FRONT setting and attached the tokens just liked what I have for the confirmation. What will be the best way to go about this?