Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
Change verbose_name for external apps in virtualennv
I have installed django-celery app in virtualenv and I want to change the label of this app to display the meaningful label on breadcrumbs navbar. I'm not able to find any solution to this problem. Can anybody help me to rename the label of app installed in virtual environment? I have chnaged the label of internal apps using verbose_name in the following code: Apps.py from django.apps import AppConfig class EmailEngineConfig(AppConfig): name = 'email_engine' verbose_name = 'Email Engine' How to perform the same task for external apps? -
Working with Django database-backed sessions in Cassandra
As django.contrib.sessions does not work with cassandra. I have tried to use Django Cassandra Engine-sessions as per this doc . After running python manage.py sync_cassandra it does created a session table in cassandra CREATE TABLE test_db.session ( session_key text PRIMARY KEY, expire_date timestamp, session_data text ) My settings.py now reads INSTALLED_APPS = [ 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', #'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'cgapp', ] INSTALLED_APPS = ['django_cassandra_engine'] + INSTALLED_APPS INSTALLED_APPS += ['django_cassandra_engine.sessions'] MIDDLEWARE = [ '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', ] DATABASES = { 'default': { 'ENGINE': 'django_cassandra_engine', 'NAME': 'test_db', 'TEST_NAME': 'test_db', 'USER': 'cassandra', 'PASSWORD': 'cassandra', 'HOST': '127.0.0.1', 'OPTIONS': { 'replication': { 'strategy_class': 'SimpleStrategy', 'replication_factor': 1 } } } } SESSION_BACKEND = 'django_cassandra_engine.sessions.backends.db' Now I am trying to store variable in session like in my views.py request.session['username'] = 'abc' request.session['user_id'] = 12 Getting below while starting my application RuntimeError: Model class django.contrib.sessions.models.Session doesn't declare an explicit app_label and isn't in an application in INSTALLED_APPS. What I am missing here. -
Deleting session variable while avoiding KeyError exception
One of the ways to delete a Django session variable is: del request.session["sess_variable"] This naturally gives a KeyError exception in case sess_variable wasn't in the request.session dictionary. To handle this exception, one can wrap the line in try, except KeyError. But is there a separate command one can use that doesn't throw an error if key doesn't exist? -
Django React Extremly Slow Website
I have one problem that I can't solve. I've developed a type foundry website to sell webfonts (digital files), but I've come accross with a big problem that I can't solve. Here's some info about he website and the server: The website is hosted on digital ocean: The VPS has 1Gb of RAM, 30GB of disc and it's running on ubuntu 14.04.5 LTS. The software installed is nginx/1.10.3 and postgresql 9.6.3 The website was developed using Django and Webpack. The requirements to install on the virtualenv are: ` Django==1.9.8 psycopg2==2.6.1 django-environ==0.4.0 numpy==1.10.4 freetype-py==1.0.2 Pillow==3.1.1 django-webpack-loader==0.2.4 fonttools==3.0.0 django-model-utils==2.4 django-admin-sortable2==0.6.3 djangorestframework==3.3.2 djangorestframework-camel-case==0.2.0 Babel==2.2.0 django-select-multiple-field==0.4.2 django-oscar-paypal==0.9.7 django-countries==3.4.1 django-widget-tweaks==1.4.1 wagtail==1.5.3 pytz==2016.1 python-stdnum==1.3 django-multiupload==0.5.1 django-object-actions==0.8.2 django-ajax-selects==1.4.3 xmltodict==0.10.2 django_cron==0.4.6` When you try to access: http://production-ndiscover.whysurreal.com/2_bruta/buy/ You will see that the website is extremely slow. I've managed to understand that I need to compress the javascript and the other one is the speed of the website. The system works this way: On Django view I get the data using a serializer, then this data is passed to React to print the data on frontend. I've used google pagespeed insights And that's where I found that I need to compress the JavaScript, but every-time I try to build … -
python elasticsearch client error: timed out while get_alias
I am new to python and elasticsearch and i am trying to run a sample application. But my elasticsearch connection shows some error. I have installed elasticsearch and started the server. In the application there is a code like this ES_URL = ['thrift://127.0.0.1:9200'] connection = pyes.ES(ES_URL) index = connection.indices.get_alias('staging-asset') when .get_alias is called, it shows Client error: timed out Traceback (most recent call last): File "/Users/shahanahamza/.virtualenvs/cms/lib/python2.7/site- packages/pyes/connection.py", line 151, in _client_call return getattr(conn.client, attr)(*args, **kwargs) File "/Users/shahanahamza/.virtualenvs/cms/lib/python2.7/site- packages/pyes/pyesthrift/Rest.py", line 41, in execute return self.recv_execute() File "/Users/shahanahamza/.virtualenvs/cms/lib/python2.7/site- packages/pyes/pyesthrift/Rest.py", line 52, in recv_execute (fname, mtype, rseqid) = self._iprot.readMessageBegin() File "/Users/shahanahamza/.virtualenvs/cms/lib/python2.7/site- packages/thrift/protocol/TBinaryProtocol.py", line 126, in readMessageBegin sz = self.readI32() File "/Users/shahanahamza/.virtualenvs/cms/lib/python2.7/site- packages/thrift/protocol/TBinaryProtocol.py", line 206, in readI32 buff = self.trans.readAll(4) File "/Users/shahanahamza/.virtualenvs/cms/lib/python2.7/site- packages/thrift/transport/TTransport.py", line 58, in readAll chunk = self.read(sz - have) File "/Users/shahanahamza/.virtualenvs/cms/lib/python2.7/site- packages/thrift/transport/TTransport.py", line 159, in read self.__rbuf = StringIO(self.__trans.read(max(sz, self.__rbuf_size))) File "/Users/shahanahamza/.virtualenvs/cms/lib/python2.7/site- packages/thrift/transport/TSocket.py", line 103, in read buff = self.handle.recv(sz) timeout: timed out Please help me to figure out the issue. Thanks in advance. -
Occasional RDS MySQL error with code 2026 (SSL connection error: protocol version mismatch)
Our production servers are setup in a VPC in AWS. Our app-servers (EC2 instances) are configured to talk to MySQL RDS in the VPC. We use Django framework which uses MySQLdb python package as the MySQL client. Since the past few months we have been getting occasional connection errors with error code 2026 (SSL connection error: protocol version mismatch). We don not have specific SSL keys setup as both the RDS and EC2 instances are in the same VPC. Any help towards figuring out the problem would be fantastic! MySQL Engine 5.5.53 Client Django 1.8.8 MySQLdb 1.2.5 -
Regex for uuid hex value in django urls
I am generating a uuid value and want to receive it from url in django, but the regex i am writing is not working and telling me page not found import uuid id = uuid.uuid4().hex print id be00e546822945bbb193b4ed80149c35 urls.py urlpatterns = [ url(r'^users/(?P<user_id>[0-9a-f]{32}\Z)/$', UserDetails.as_view(), name = 'users_detail'), ] Result: "GET /users/be00e546822945bbb193b4ed80149c35/ HTTP/1.1" 404 3302 So what would be the correct regex for uuid hex value in urls.py ? -
Regex for uuid hex value in django urls
I am generating a uuid value and want to receive it from url in django, but the regex i am writing is not working and telling me page not found import uuid id = uuid.uuid4().hex print id be00e546822945bbb193b4ed80149c35 urls.py urlpatterns = [ url(r'^users/(?P<user_id>[0-9a-f]{32}\Z)/$', UserDetails.as_view(), name = 'users_detail'), ] Result: "GET /users/be00e546822945bbb193b4ed80149c35/ HTTP/1.1" 404 3302 So what would be the correct regex for uuid hex value in urls.py ? -
Which is the appropriate way to add templates into forms
I've got a form in which I would like to put some predefined templates, in order to fill it more quickly. Like if I would define a text message template in my phone, to say 'I am arrived', ... I could use the help_text but I want to have the choice between differents sentences. I had a look on google but haven't find which would be the appropriate way to do it. Is there a good way to do it? My model is: class Project(models.Model): project_scope = models.IntegerField(choices=PROJECT_STATUS,default=1) My form is: class ScopeForm(forms.ModelForm): def __init__(self, *args, **kwargs): super(ScopeForm, self).__init__(*args, **kwargs) for field in self.fields: self.fields[field].required = False class Meta: model = Project fields = ['project_scope',] -
Which is the appropriate way to add templates into forms
I've got a form in which I would like to put some predefined templates, in order to fill it more quickly. Like if I would define a text message template in my phone, to say 'I am arrived', ... I could use the help_text but I want to have the choice between differents sentences. I had a look on google but haven't find which would be the appropriate way to do it. Is there a good way to do it? My model is: class Project(models.Model): project_scope = models.IntegerField(choices=PROJECT_STATUS,default=1) My form is: class ScopeForm(forms.ModelForm): def __init__(self, *args, **kwargs): super(ScopeForm, self).__init__(*args, **kwargs) for field in self.fields: self.fields[field].required = False class Meta: model = Project fields = ['project_scope',] -
How to integrate django-zinnia into an existing django website
I have built a django website, which requires blog functionality. Rather than roll my own, I have decided to use django-zinnia, to provide blog functionality for my site. However, I can't seem to find any documentation that shows how to integrate django-zinnia into aan existing django website. The app comes with it's own templates - which I'm very grateful for - but look NOTHING like the rest of my site. I want to know how I can incorporate the Zinnia functionality within my website - for example: Show the following items on my home page: (last N blog items, M most viewed/popular blogs, last X comments). Use my own template for viewing a blog How may I do this? I am thinking of looking at the Zinnia templates (if I can find where they're located), and then ripping out sections of the template code and using that in my website templates - but that would be only done as a last resort, as that may lead to unintended consequences, since I don't yet know enough of the Zinnia internals, to be sure at this stage. So my question again is, how can I integrate Zinnia into mysebsite, using my own … -
How to integrate django-zinnia into an existing django website
I have built a django website, which requires blog functionality. Rather than roll my own, I have decided to use django-zinnia, to provide blog functionality for my site. However, I can't seem to find any documentation that shows how to integrate django-zinnia into aan existing django website. The app comes with it's own templates - which I'm very grateful for - but look NOTHING like the rest of my site. I want to know how I can incorporate the Zinnia functionality within my website - for example: Show the following items on my home page: (last N blog items, M most viewed/popular blogs, last X comments). Use my own template for viewing a blog How may I do this? I am thinking of looking at the Zinnia templates (if I can find where they're located), and then ripping out sections of the template code and using that in my website templates - but that would be only done as a last resort, as that may lead to unintended consequences, since I don't yet know enough of the Zinnia internals, to be sure at this stage. So my question again is, how can I integrate Zinnia into mysebsite, using my own … -
google maps with django
Hello i need that the user determines his location on google map when he enters his name and last name.. This is the picture. On the location i need to have google maps. I don't know why the map didn't appear. Image this is the Models.py class Profile(models.Model): user = models.OneToOneField(User) expiration = models.DateField('expiration date') phone = models.CharField('phone', max_length=20, blank=True, null=True) category = models.CharField('category', choices=CATEGORY_CHOICES,max_length=50, blank=True, null=True) university = models.ForeignKey('University', null=True, blank=True) fininstitution = models.ForeignKey('FinancialInstitution', null=True, blank=True) city = models.CharField(max_length=255) location = PlainLocationField(based_fields=['city'], zoom=7) This is the Forms.py class UserForm(forms.ModelForm): class Meta: model = User fields = [ 'first_name', 'last_name', 'email' ] class ProfileForm(forms.ModelForm): class Meta: model = Profile exclude = [ 'user', 'expiration', 'university', 'fininstitution',] This is the Profile.html: <div class="page-header"> <h1>Profile</h1> </div> <div class="row"> <div class="col-md-6"> {% if user.profile.is_active %} <p>Your account is "Active" till <span class='label {% if user.profile.expire_soon %}label-warning{% else %}label-success{%endif%}'>{{ user.profile.get_expired_at }}</span> </p> <p> <a href='' class='btn btn-primary'>Buy now</a> one of our plans </p> {% else %} <p> Your account has <span class='label label-warning'>"Expired"</span> <a href='{% url 'payments' %}' class='btn btn-primary'>Buy now</a> in order to extend. </p> {% endif %} </div> </div> <hr/> <div class='row'> <div class="col-md-6"> <form method='post'> {% csrf_token %} {{user_form.as_p }} <hr/> … -
google maps with django
Hello i need that the user determines his location on google map when he enters his name and last name.. This is the picture. On the location i need to have google maps. I don't know why the map didn't appear. Image this is the Models.py class Profile(models.Model): user = models.OneToOneField(User) expiration = models.DateField('expiration date') phone = models.CharField('phone', max_length=20, blank=True, null=True) category = models.CharField('category', choices=CATEGORY_CHOICES,max_length=50, blank=True, null=True) university = models.ForeignKey('University', null=True, blank=True) fininstitution = models.ForeignKey('FinancialInstitution', null=True, blank=True) city = models.CharField(max_length=255) location = PlainLocationField(based_fields=['city'], zoom=7) This is the Forms.py class UserForm(forms.ModelForm): class Meta: model = User fields = [ 'first_name', 'last_name', 'email' ] class ProfileForm(forms.ModelForm): class Meta: model = Profile exclude = [ 'user', 'expiration', 'university', 'fininstitution',] This is the Profile.html: <div class="page-header"> <h1>Profile</h1> </div> <div class="row"> <div class="col-md-6"> {% if user.profile.is_active %} <p>Your account is "Active" till <span class='label {% if user.profile.expire_soon %}label-warning{% else %}label-success{%endif%}'>{{ user.profile.get_expired_at }}</span> </p> <p> <a href='' class='btn btn-primary'>Buy now</a> one of our plans </p> {% else %} <p> Your account has <span class='label label-warning'>"Expired"</span> <a href='{% url 'payments' %}' class='btn btn-primary'>Buy now</a> in order to extend. </p> {% endif %} </div> </div> <hr/> <div class='row'> <div class="col-md-6"> <form method='post'> {% csrf_token %} {{user_form.as_p }} <hr/> … -
Django PrimaryKeyRelatedField queryset when allow_null=True
I'm very new to both Python and Django and I'm having issues with a nullable Foreign Key relation. I found similar issues to this one, but none of them seemed to be covering my use case. I'm using Django 1.8.17, and DRF 3.1.0 I have the following classes in Django (I've simplified them out to just the relevant fields since I can't easily copy/paste my code here): class Rationale(models.Model): id = models.AutoField(primary_key=True) name = models.CharField(max_length=255) class Alert(models.Model): id = models.AutoField(primary_key=True) rationale = models.ForeignKey(Rationale, null=True, blank=True) priority = models.IntegerField(default=1) class AlertHistory(models.Model): id = models.AutoField(primary_key=True) alert = = models.ForeignKey(Alert) rationale = models.ForeignKey(Rationale, null=True, blank=True) priority = models.IntegerField(null=True) The idea here is to capture changes to the alert in the history table. A user can update the priority or the Rationale. The Rationale table is look-up that is pre-populated with a JSON fixture. A user can select a rationale to give the reason why the alert is open. Rationale is optional though, and therefore nullable. However I get an error when I try to set the Rationale to None: {'rationale': [u'Incorrect type. Expected pk value, received unicode.']} So searching around led me to: the PrimaryKeyRelatedField: http://www.django-rest-framework.org/api-guide/relations/#primarykeyrelatedfield I then updated my AlertHistory serializer: class … -
Django PrimaryKeyRelatedField queryset when allow_null=True
I'm very new to both Python and Django and I'm having issues with a nullable Foreign Key relation. I found similar issues to this one, but none of them seemed to be covering my use case. I'm using Django 1.8.17, and DRF 3.1.0 I have the following classes in Django (I've simplified them out to just the relevant fields since I can't easily copy/paste my code here): class Rationale(models.Model): id = models.AutoField(primary_key=True) name = models.CharField(max_length=255) class Alert(models.Model): id = models.AutoField(primary_key=True) rationale = models.ForeignKey(Rationale, null=True, blank=True) priority = models.IntegerField(default=1) class AlertHistory(models.Model): id = models.AutoField(primary_key=True) alert = = models.ForeignKey(Alert) rationale = models.ForeignKey(Rationale, null=True, blank=True) priority = models.IntegerField(null=True) The idea here is to capture changes to the alert in the history table. A user can update the priority or the Rationale. The Rationale table is look-up that is pre-populated with a JSON fixture. A user can select a rationale to give the reason why the alert is open. Rationale is optional though, and therefore nullable. However I get an error when I try to set the Rationale to None: {'rationale': [u'Incorrect type. Expected pk value, received unicode.']} So searching around led me to: the PrimaryKeyRelatedField: http://www.django-rest-framework.org/api-guide/relations/#primarykeyrelatedfield I then updated my AlertHistory serializer: class … -
What codes belongs in a Django app and what is the correct naming convention
I've recently started with Django web application development and now I want to put wood behind the arrow. To do the job properly I started over and started to think of a correct naming convention for my web application. I've read through this blog article. Until now, I've just created a project called myproject and the app is called myproject_app. I realized, the only thing my myproject_app does is have the models.py with the database scheme, so I wondered if that is the way to go, or if I took a wrong turn somewhere. With the app having nothing more that the description of my database, it's hard to think of a proper name and not just suffix it with _db or something like that. To my question: What code belongs to a Django app and what is the appropriate naming convention for such apps? edit: I did come by this Stackoverflow question, but it does not cover the code one is supposed to have in the Django app, just like it doesn't cover that in the blog article. -
What codes belongs in a Django app and what is the correct naming convention
I've recently started with Django web application development and now I want to put wood behind the arrow. To do the job properly I started over and started to think of a correct naming convention for my web application. I've read through this blog article. Until now, I've just created a project called myproject and the app is called myproject_app. I realized, the only thing my myproject_app does is have the models.py with the database scheme, so I wondered if that is the way to go, or if I took a wrong turn somewhere. With the app having nothing more that the description of my database, it's hard to think of a proper name and not just suffix it with _db or something like that. To my question: What code belongs to a Django app and what is the appropriate naming convention for such apps? -
How to test a delete request in django
I am testing the DeleteView but I found that the object is not been deleted. I have a DELETE request but nothing is deleted. Python debugger (Pdb) url '/blog/delete/11/' (Pdb) response.context [ {'True': True, 'False': False, 'None': None}, {'request_path': '/blog/delete/11/', 'exception': 'No article found matching the query'} ] (Pdb) response.status_code 404 (Pdb) response.wsgi_request.method 'DELETE' (Pdb) Article.objects.get(pk=11) <Article: BDxhKFIkoN> (Pdb) Article.objects.all().count() 10 #should be 9 test_views.py def test_ArticleDeleteView_should_delete_and_redirect(self): #deleting previous objects Article.objects.all().delete() User.objects.all().delete() #Fixtures : Creating 10 Articles articles = mixer.cycle(10).blend(Article) #getting an Article to Delete article = Article.objects.first() client = Client() url = reverse('blog:delete', kwargs={'pk': article.pk}) #delete the Article response = client.delete(url) #start the debugger pytest.set_trace() self.assertEqual(response.wsgi_request.method, 'DELETE') self.assertEqual(response.status_code, 302) count_number_of_articles = Article.objects.all().count() #pytest.set_trace() self.assertEqual(9, count_number_of_articles) views.py class ArticleDeleteView(DeleteView): model = Article success_url = reverse_lazy('blog:articles') urls.py urlpatterns = [ url(r'^$', BlogHomeListView.as_view(), name="articles"), #CRUD ... url(r'^delete/(?P<pk>\d+)/$', ArticleDeleteView.as_view(), name="delete"), ... ] -
How to test a delete request in django
I am testing the DeleteView but I found that the object is not been deleted. I have a DELETE request but nothing is deleted. Python debugger (Pdb) url '/blog/delete/11/' (Pdb) response.context [ {'True': True, 'False': False, 'None': None}, {'request_path': '/blog/delete/11/', 'exception': 'No article found matching the query'} ] (Pdb) response.status_code 404 (Pdb) response.wsgi_request.method 'DELETE' (Pdb) Article.objects.get(pk=11) <Article: BDxhKFIkoN> (Pdb) Article.objects.all().count() 10 #should be 9 test_views.py def test_ArticleDeleteView_should_delete_and_redirect(self): #deleting previous objects Article.objects.all().delete() User.objects.all().delete() #Fixtures : Creating 10 Articles article = mixer.cycle(10).blend(Article) #getting an Article to Delete article = Article.objects.first() client = Client() url = reverse('blog:delete', kwargs={'pk': article.pk}) #delete the Article response = client.delete(url) #start the debugger pytest.set_trace() self.assertEqual(response.wsgi_request.method, 'DELETE') self.assertEqual(response.status_code, 302) count_number_of_articles = Article.objects.all().count() #pytest.set_trace() self.assertEqual(9, count_number_of_articles) views.py class ArticleDeleteView(DeleteView): model = Article success_url = reverse_lazy('blog:articles') urls.py urlpatterns = [ url(r'^$', BlogHomeListView.as_view(), name="articles"), #CRUD ... url(r'^delete/(?P<pk>\d+)/$', ArticleDeleteView.as_view(), name="delete"), ... ] -
Django Update field of three models with same name via ModelForm Field
I've created a form that has a notes field and when the end user fills in the notes field and hits submit i need it to not only save the text in ModelOne Notes but also update the notes field in ModelTwo & ModelThree with the same text. Current Code: View.py class CommandRadioView(FormView): template_name = 'Gameflow/command_call_notes.html' form_class = CommandCallForm def get(self, request, *args, **kwargs): self.mission = get_object_or_404(Mission, pk=kwargs.get('mission_id', None)) kwargs['user_id'] = self.mission.proposal.user.id self.radio = get_object_or_404(CommandPhone, pk=kwargs.get('radio_id', None)) phone_type = CommandPhoneCallType( description=' General Comm', phonecall=self.radio ) phone_type.save() self.mission.complete_mission( request.user, self.radio.created_at ) return super().get(request, *args, **kwargs) def post(self, request, *args, **kwargs): if "save" in request.POST: return super().post(request, *args, **kwargs) else: url = self.get_success_url() return HttpResponseRedirect(url) def form_valid(self, form): self.object = form.save(commit=False) self.object.save() return super().form_valid(form) Form.py: class CommandCallForm(forms.ModelForm): class Meta: model = Mission fields = ['notes'] def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.helper = FormHelper() self.helper.form_id = 'user_form' self.helper.form_class = 'form-horizontal' self.helper.label_class = 'col-lg-3' self.helper.field_class = 'col-lg-8' self.helper.layout = Layout( Field( 'notes', ), FormActions( Submit('save', 'Submit'), Button('cancel', 'Cancel', css_class='cancel') ) ) Anything missing what you need to view just let me know cheers. -
Django Update field of three models with same name via ModelForm Field
I've created a form that has a notes field and when the end user fills in the notes field and hits submit i need it to not only save the text in ModelOne Notes but also update the notes field in ModelTwo & ModelThree with the same text. Current Code: View.py class CommandRadioView(FormView): template_name = 'Gameflow/command_call_notes.html' form_class = CommandCallForm def get(self, request, *args, **kwargs): self.mission = get_object_or_404(Mission, pk=kwargs.get('mission_id', None)) kwargs['user_id'] = self.mission.proposal.user.id self.radio = get_object_or_404(CommandPhone, pk=kwargs.get('radio_id', None)) phone_type = CommandPhoneCallType( description=' General Comm', phonecall=self.radio ) phone_type.save() self.mission.complete_mission( request.user, self.radio.created_at ) return super().get(request, *args, **kwargs) def post(self, request, *args, **kwargs): test = '' def form_valid(self, form): self.object = form.save(commit=False) self.object.save() return super().form_valid(form) Form.py: class CommandCallForm(forms.ModelForm): class Meta: model = Mission fields = ['notes'] def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.helper = FormHelper() self.helper.form_id = 'user_form' self.helper.form_class = 'form-horizontal' self.helper.label_class = 'col-lg-3' self.helper.field_class = 'col-lg-8' self.helper.layout = Layout( Field( 'notes', ), FormActions( Submit('save', 'Submit'), Button('cancel', 'Cancel', css_class='cancel') ) ) Anything missing what you need to view just let me know cheers. -
i need to re-run the project on my PC where django==1.9
I tried tore-run project on my PC. the project requeirements Django==1.9. I have installed Django==1.9 and tried to run, but I got an error. no module named' sqlserver_ado". So what I have to do -
i need to re-run the project on my PC where django==1.9
I tried tore-run project on my PC. the project requeirements Django==1.9. I have installed Django==1.9 and tried to run, but I got an error. no module named' sqlserver_ado". So what I have to do -
Zero Downtime Code Update for Django App
Things being used: Supervisor to run uwsgi uwsgi to bring up my Django non-rel 1.6 based ML app (Django Upgrade in process) I am using Uwsgi to start my Django ML based app. But somehow as it has to load a lot of binaries for initialization, it takes about 20-30 seconds for supervisor to restart and load new code. How can I reduce this time? or is there any other way to run the Django app so as to reload quickly when code changes? With ZERO downtime? as Nginx will start throwing 5xx if it can't connect to Django.