Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
Have django to automatically create database on "migrate"
There is a way to have django automatically create the database (on a postgreSQL server) like it do when creating test database ? My final goal is to have one database for each git branch. -
Django QuerySet filter over string
I have a models.py file with some rows and I would like to return on my HTML template all rows corresponding to my filter QuerySet. #models.py def Test(request) : CarCollection = MyModel.objects.filter(car="old") context = { "CarCollection" : CarCollection } return render(request, 'car.html', context) My html template looks like : <!-- car.html --> {% block content %} <ul> {% for car in CarCollection %} <li>{{ car }}</li> {% endfor %} </ul> {% endblock %} But my objects looks like : Volvo_old_car Audi_old_car Nissan_new_car old_Bentley So I would like to isolate a string in my object (old for example) and return all objects with this string. But this string could be at the beginning, at the middle or at the end. The filter will return : Volvo_old_car Audi_old_car old_bentley I need to use Regex to do that ? Thank you by advance -
Repeated queries to MySQL backend in Django?
I'm looking at my views with django debug toolbar and I noticed that for every request Django starts with the following two queries: SELECT @@SQL_AUTO_IS_NULL SELECT VERSION() I guess these are some kind of "feature detection" queries, however I find it weird that they are executed at every request. My first try to solve this was to enable persistent connections (DATABASES['default']['CONN_MAX_AGE'] = None) together with django-mysqlpool however it doesn't seem to solve the problem. My question is: is this a (potential) performance bug? Would it make sens to report it to the Django project? has anyone solved this successfully (as in eliminating this two initial queries)? If so, how? Some more details: I'm using Django 1.10.2 running under Google Appengine with CloudSQL (their hosted MySQL solution) -
Get URL from media with python-twitter in Django
I'm currently using python-twitter for a personal project, I'm able to retrieve all the filtered data I need (mentions to a set of users) but I need to extract the DisplayURL from the media object. I do a: {% for tweet in tweets %} {{ tweet.media|safe }} {% endfor %} Which results in: [Media(ID=802077234601279488, Type=photo, DisplayURL='pic.twitter.com/QDoSBaQLxv')] How can I actually get the DisplayURL on it? I tried with: {{ tweet.media.DisplayURL }} {{ tweet.media[Media].DisplayURL }} {{ tweet.media.Media.DisplayURL }} But none of those work. Thanks -
Django link to iOS manifest view for download
How exactly would it work to link to a view where the manifest.plist is linked from? def ManifestView(request, file, file_id): template = loader.get_template('ios/manifest.plist') file = File.objects.get(pk=file_id) context = {'url': url, 'file_id': file_id, 'title': title} return HttpResponse(template.render(context, request), content_type='text/xml') I currently link to the manifest using this, where the url would be the link to the .ipa file etc. In my template however, I have this, where ios-manifest links to the ManifestView above: <a href="itms-services://?action=download-manifest&url={% url 'ios-manifest' file=file.project.name file_id=file.pk %}" type="button">.</a> This does not trigger the action to download, and i'm guessing because the {% url %} is only relative. How would it then work to download this manifest using the itms-service://?action string? -
How do I set a Dynamic Choice Field using a Model field in Django
How can I use 'Dynamic Choices' generated from another Model field? I would like to add a new choice to a field called color without editing code/tuple. The example below demonstrations what I have already tried, but in this example 'choices' doesn't expect a model to be used so this will not work! Is this possible, if so what would be the best approach? class Furniture(models.Model): color = models.CharField(max_length=50, choices=FurnitureChoices) class FurnitureChoices(models.Model): color = models.CharField(max_length=50) -
Handle Django QuerySet
I'm learning about Dango QuerySet and I get a problem with what I wrote today. This is my models.py : class Identity(models.Model): title = models.CharField(max_length=12,choices=TITLE_CHOICES, verbose_name='Civilité') lastname = models.CharField(max_length=30, verbose_name='Nom de famille') firstname = models.CharField(max_length=30, verbose_name='Prénom(s)') sex = models.CharField(max_length=1, choices=SEX_CHOICES, verbose_name='sexe') birthday = models.DateField(verbose_name='Date de naissance') birthcity = models.CharField(max_length=30, verbose_name='Ville de naissance') birthcountry = models.ForeignKey(Country, related_name='Pays_naissance', verbose_name='Pays de Naissance') nationality = models.CharField(max_length=30, verbose_name='Nationalité') job = models.CharField(max_length=30, verbose_name='Profession') adress = models.CharField(max_length=30, verbose_name='Adresse') city = models.CharField(max_length=30, verbose_name='Ville') zip = models.IntegerField(verbose_name='Code Postal') country = models.ForeignKey(Country, related_name='Pays1', verbose_name='Pays') mail = models.CharField(max_length=30, verbose_name='Email', null=True) phone = models.CharField(max_length=20, verbose_name='Téléphone', null=True) def __unicode__(self): return '%s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s' % (self.id, self.title, self.lastname, self.firstname, self.sex, self.birthday, self.birthcity, self.birthcountry, self.nationality, self.job, self.adress, self.city, self.zip, self.country, self.mail, self.phone) This is my views.py : #-*- coding: utf-8 -*- from django.shortcuts import render, render_to_response from django.http import HttpResponseRedirect, HttpResponse from django.template import loader from .models import Identity, Country from .forms import IdentityForm # Create your views here. def IdentityAccueil(request) : # Fonction permettant de créer la page d'accueil de la rubrique Acte de Naissance #Cherche le fichier html accueil et le renvois template = loader.get_template('accueil_Identity.html') return HttpResponse(template.render(request)) #def IdentityTest(request) : … -
How to make a BinaryField editable in django?
Here is my code: #models.py class Upload(models.Model): #image = models.FileField() #working code image = models.BinaryField() #not working #forms.py class UploadModelForm(forms.ModelForm): class Meta: model = Upload fields = ('image') labels = { 'image': "Upload Image" } widgets = { 'image' : forms.FileInput(attrs={'multiple': True}) } When I run that, it throws the following error: 'image' cannot be specified for Upload model form as it is a non-editable field But when I change the BinaryField to FileField, it is working fine. The problem is, in my database, FileField has a DataType char which is not what I want. I want the DataType to be blob. -
Uploading a file via HTTP PUT in Python
I'm trying to upload a file through HTTP PUT but as there is no request.FILES in PUT I don't know how to tackle this. Is there a solution to do it with PUT? -
Login page doesn't show in django all-auth
I am having a problem with django allauth login page. I was able to complete the tutorial django all-auth, however I encountered a problem with the login page when I tried http://localhost/accounts/login/ nothing is showing but only a blank page. And the tutorial does not show how to create the login page, so I guess that is the last step I should be working on. Thank you soo much, your help is much appreciated. -
Ajax ABORT leads to Django errno 10053 - An established connection was aborted by the software in your host machine
I have a web-page (Django 1.9 on back-end, Apache server) with an endless-paginated table with large data set and column filters. When a user activates one filter (let's denote it CHOICE 1), and then instantly changes his mind resetting the filter (let's refer to it as CHOICE 2), I would like to tell Ajax to give up waiting for back-end response to CHOICE 1 and go on to posting and waiting for CHOICE 2 request. For this purpose, I had the following JS code: // AJAX_GET_REQUEST is a global variable AJAX_GET_REQUEST= $.ajax( { type:'GET', url:"/my_url/", beforeSend : function() { if (AJAX_GET_REQUEST!= null) AJAX_GET_REQUEST.abort(); }, data:data, success: function(response) { // Do something } }); Fine. I used to think that I achieved the goal of successfully canceling irrelevant requests, But I found out that AJAX_GET_REQUEST.abort(); leads to Django error [Errno 10053] An established connection was aborted by the software in your host machine. The interesting think is that this is not a 'fatal error' in that the app does not terminate, but rather it takes years for my paginated table to load. Django seems to reactivate connection itself and go on to handle last request. Finally after waiting for long time … -
Django - Method Not Allowed on Function Based View (FBV)
I am getting a 405 METHOD NOT ALLOWED response when I am trying to submit a POST request through an AJAX call: "POST /events/profile_update/ HTTP/1.1" 405 0 I'm trying to set this up with the most basic view: def profile_update(request): if request.method == "POST": name_form =forms.EventName(request.POST) if name_form.is_valid(): name = name_form.cleaned_data['name'] else: name_form = forms.EventName() return render(request, 'event_edit_profile.html', {"name": name}) my urls.py: urlpatterns = [ url(r'^(?P<slug>[-\w]+)/update/$', views.EventProfileUpdateView.as_view(), name='event_profile_update'), url(r'^profile_update/$', views.profile_update, name="profile_update"), ] And in my template, I am using x-editable inline editing to submit the request: <h1 id="name" data-type="text" data-pk="{{ object.id }}" data-url="{% url 'Events:profile_update' %}" data-title="Event Name" data-params="{csrfmiddlewaretoken:'{{csrf_token}}'}">{{ object.name }}</h1> The request seems to be coming through, and is not being rejected due to CSRF, given that I don't get a 403, but rather a 405: "POST /events/profile_update/ HTTP/1.1" 405 0 For some reason, I can't seem to get past this. Anyone have any ideas as to what could be screwing me up? -
if i am modify models.IntegerField to models.ForeignKey im model ,inspite of using Django's double underscore convention i am getting error
raise TypeError('Related Field got invalid lookup: %s' % lookup_type) TypeError: Related Field got invalid lookup: icontains if i am modify models.IntegerField to models.ForeignKey im model (Django/python) and crossponding table column then why i am getting error related to icontains. inspite of using Django's double underscore convention -
return data from $.ajax to use later
I need to set yeast_options on my viewmodel in knockoutjs. I am serving the data correctly, but cannot access it with an ajax call. Ajax is not used the way I'd expect. I want to use functions to return what they create, and ajax is requiring to use a "success" function, which is not setting data onto my yeast_options attribute: self.get_yeasts = function(){ console.log('in get_yeasts...') // var this_data = null; var onSuccess = function(data){ alert("It worked!"); alert(data); alert(self); console.log(data); // var this_data = data; self.yeast_options = data; return data; } var onError = function(error){ alert("oops"); } var data = $.ajax({ dataType: "json", url: "http:/127.0.0.1:8000/api/items/yeasts", success: onSuccess, error: onError, }); // }); console.log("about to return the data"); console.log(data); console.log(data.responseJSON); // debugger; return this_data; } I've tried several different ways, like returning data from the success function, setting self.yeast_options within the success, and nothing will get the data to it <script type='text/javascript'> ko.observableArray.fn.countVisible = function(){ return ko.computed(function(){ var items = this(); if (items === undefined || items.length === undefined){ return 0; } var visibleCount = 0; for (var index = 0; index < items.length; index++){ if (items[index]._destroy != true){ visibleCount++; } } return visibleCount; }, this)(); }; function Hop(data) { this.name = … -
overwrite django restframework CreateModelMixin serializer error message
I am using Django Restframework 3.3.3, and I am trying to use the generic views, but I was hoping to overwrite the serializer validation error message. I got the following code, which got a "name field cannot be blank" when the name field is not given. class PositionList(generics.ListCreateAPIView): """Get the Position list, or add another Position only when you are admin""" renderer_classes = ((BrowsableAPIRenderer, JSONRenderer)) permission_classes = (IsAuthenticatedOrReadOnly, IsAdminOrReadOnly,) queryset = Position.objects.filter() serializer_class = PositionSerializer My question is: is there a way to customize the error messages. The following methods dose not work for me: (1). Overwrite the init method in the serializer class: def __init__(self, *args, **kwargs): super(UserSerializer, self).__init__(*args, **kwargs) self.fields['name'].error_messages['required'] = 'My custom required msg' (2). Give the error message in the serializer class: class PositionSerializer(serializers.ModelSerializer): class Meta: model = MyModel fields = ('id', 'name', 'description') extra_kwargs = {"name": {"required": _("Customized message goes here")}} Any advises are welcomed, thanks in advanced. -
Django server stuck on Beanstalkd
I'm trying to setup a django server with existing code. But I seemed to be stuck on this while trying to start server using python manage.py runserver this the traceback: (camdyvirtualenv) Mac-mini-3:big-picture-api Sqooge_Ahmed$ python manage.py runserver Traceback (most recent call last): File "manage.py", line 10, in <module> execute_from_command_line(sys.argv) File "/Users/Sqooge_Ahmed/Documents/Django/camdyvirtualenv/lib/python2.7/site-packages/django/core/management/__init__.py", line 338, in execute_from_command_line utility.execute() File "/Users/Sqooge_Ahmed/Documents/Django/camdyvirtualenv/lib/python2.7/site-packages/django/core/management/__init__.py", line 303, in execute settings.INSTALLED_APPS File "/Users/Sqooge_Ahmed/Documents/Django/camdyvirtualenv/lib/python2.7/site-packages/django/conf/__init__.py", line 48, in __getattr__ self._setup(name) File "/Users/Sqooge_Ahmed/Documents/Django/camdyvirtualenv/lib/python2.7/site-packages/django/conf/__init__.py", line 44, in _setup self._wrapped = Settings(settings_module) File "/Users/Sqooge_Ahmed/Documents/Django/camdyvirtualenv/lib/python2.7/site-packages/django/conf/__init__.py", line 92, in __init__ mod = importlib.import_module(self.SETTINGS_MODULE) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/importlib/__init__.py", line 37, in import_module __import__(name) File "/Users/Sqooge_Ahmed/Documents/Django/camdyvirtualenv/Camdy-APIs/big-picture-api/bigpicture/settings.py", line 5, in <module> from pystalkd.Beanstalkd import Connection as beanstalkdConnect File "/Users/Sqooge_Ahmed/Documents/Django/camdyvirtualenv/lib/python2.7/site-packages/pystalkd/__init__.py", line 20, in <module> from . import Beanstalkd, Job File "/Users/Sqooge_Ahmed/Documents/Django/camdyvirtualenv/lib/python2.7/site-packages/pystalkd/Beanstalkd.py", line 156 def send_command(self, command, *args, ok_status=None, error_status=None): ^ SyntaxError: invalid syntax -
optimize image inside desired folder
I am using webpack for bundling. I am using reactjs and django. I want the static files used by Django and reactjs be separate. I could minified image but the minified images are saved to the folder where the output file is bundled. I want all the minified images to be saved inside frontend -> assets folder. How can i do it so? The project structure looks like following app - its a directory where static files are kept for Django. Webpack bundles the react files to app.js and is placed over here because Django template need it to render in its template as <script src='app/bundle/js/app.js'></script>. frontend - It's a directory where all the react files reside. I want the images to be inside this directory(assets/images/). Images that will be used in reactjs. How can i do it so? my webpack right now is configured this way const path = require("path"); if(!process.env.NODE_ENV) { process.env.NODE_ENV = 'development'; } module.exports = { entry: [ './src/index.js' ], output: { path: path.join("../app/static/build/", "js"), filename: "app.js", publicPath: "../app/static/build/" }, devtoo: 'source-map', debug: true, module: { loaders: [{ exclude: /node_modules/, loader: 'babel', query: { presets: ['react', 'es2015', 'stage-1'] } }, {test: /\.(jpe?g|png|gif|svg)$/i, loader: "file-loader?name=images/[name].[ext]"}, ] }, … -
Which django pattern allows referencing a foreign key in models?
I've attempted InlineForms, Django-Polymorphic, Multimodelform, and every other solution and now I'm very very confused on the solution I should be chasing now... are foreign keys really this hard? I just want two tables, Repeater, RepeaterDCS. After I create a Repeater object, I want to create a RptrDCS object with a foreign relation to my new Repeater object. This will be done with about 25 tables (so 25 forms I guess?), my point is to avoid simply adding 25 columns to Repeater which will bring down any database server. My forms never validate and the best the Django catches is "Error rptr, Error dcs" which doesn't seem to have access to what failed. {{ form.1.errors }} and {{ form.errors }} doesn't reveal anything useful either. What's happening here? Do I need to use django-polymorphism or inline-formset, and if so how? models.py class Rptr(models.Model): class Meta: db_table = u'dcs' seq=models.AutoField(primary_key=True) callsign=models.CharField( max_length=20, null=False ) frequency = models.CharField( max_length=8, null=True ) def __unicode__(self): return u'%d %s %s' % (self.seq, self.callsign, self.frequency) class RptrDCS(models.Model): class Meta: db_table = 'repeater' seq=models.AutoField(primary_key=True) code=models.CharField( max_length=64, null=False ) repeater_id = models.ForeignKey( Rptr, null=False ) def __unicode__(self): return u'%d %s %s' % ( self.seq, self.code, self.repeater_id, ) forms.py … -
Django's MutiTable Vs. Abstract Inheritance
While there is general consensus that multi-table inheritance isn't a very good idea in the long term (Jacobian, Others), am wondering if in some use cases the "extra joins" created by django during querying might be worth it. My issue is having a Single Source of Truth in the database. Say, for Person Objects who are identified using an Identity Number and Identity Type. E.g. ID Number 222, Type Passport. class Person(models.Model): identity_number = models.CharField(max_length=20) identity_type = models.IntegerField() class Student(Person): student_number = models.CharField(max_length=20) class Employee(Person): employee_number = models.CharField(max_length=20) In abstract inheritance, any subclass model of person e.g. Student, Parent, Supervisor, Employee etc inheriting from a Person Abstract Class will have identity_number & identity_type stored in their respective tables In multi-table inheritance, since they all share the same table, I can be sure that if I create a unique constraint on both columns in the Person Model then no duplicates will exist in the database. In the abstract inheritance, to keep out duplicates in the database, one would have to build extra validation logic into the application thus also slightly degrading performance meaning it cancels out the "extra join" that django has to do with a concrete inheritance? -
Editing users message by using original message form
I am currently trying to create an edit message function on a discussion board. I want to be able to edit the message from the original text area showing the original text inside. What is the best way to start his approach in python django? -
How to get parameters from current url
Is it possible to get an specific parameter in a url and use it in a template ? `{{ request.path }} It gets the whole url, i need only the 'pk' parameter, to make a link to another page. Thanks. -
No 'Access-Control-Allow-Origin' header is present on the requested resource. OR Response to preflight request doesn't pass access control check
I get the template error XMLHttpRequest cannot load http://127.0.0.1:8000/api/items/yeasts. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access. hitting api/items/views.py: import json from django.shortcuts import render from rest_framework import status from rest_framework.decorators import api_view, permission_classes from rest_framework.response import Response @api_view(['GET']) def serve_yeasts(request): """ Serve up some yeasts """ data = [ {'category': 'Danstar', 'yeasts': ['Danstar 1', 'Danstar 2']}, {'category': 'Fermentis', 'yeasts': ['West Coast', 'American Saison', 'White Wine']}, {'category': 'White Labs', 'yeasts': ['White 1', 'White Saison']}, ] return Response(data=data, status=status.HTTP_200_OK) with self.get_yeasts = function(){ var data = $.ajax({ dataType: "json", url: "http:/127.0.0.1:8000/api/items/yeasts", success: onSuccess, error: onError, }); } If I change this to self.get_yeasts = function(){ var data = $.ajax({ dataType: "json", url: "http:/127.0.0.1:8000/api/items/yeasts", success: onSuccess, error: onError, beforeSend: function (request) { request.setRequestHeader("Authorization", "Negotiate"); }, aysnc: true, }); } as suggested, I get XMLHttpRequest cannot load http://127.0.0.1:8000/api/items/yeasts. Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access. instead. settings.py: """ Django settings for homebrew_app project. For more information on this file, see https://docs.djangoproject.com/en/1.7/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.7/ref/settings/ """ # Build paths inside … -
list_display with count of ForeignKey item in Django Admin
I am new to Python and Django. I was trying to count the foreign key items/records of an object and display it as a column in the Admin list_display. Here's the models.py: class Author(models.Model): name = models.CharField( max_length=100, ) class Meta: ordering = ['-name '] verbose_name = _('Author') verbose_name_plural = _('Authors') def __str__(self): return self.author @models.permalink def get_absolute_url(self): return reverse('author_detail', kwargs={'pk': self.pk}) class Book(models.Model): author = models.ForeignKey( 'Author', related_name='menu_items', verbose_name=_('author'), ) bookname= models.CharField( max_length=100, ) publisher= models.CharField( max_length=100, ) class Meta: ordering = ['-bookname'] verbose_name = _('Book') verbose_name_plural = _('Books') def __str__(self): return self.bookname @models.permalink def get_absolute_url(self): return ('book_detail', [self.pk]) Here's the admin.py from django.contrib import admin from .models import Author, Book class BookInline(admin.TabularInline): model = Book extra = 1 @admin.register(Loan) class LibraryAdmin(admin.ModelAdmin): def NumberOfBooks(self, obj): #I guess sth is wrong here when trying to count the book_set return obj.book_set.count() NumberOfBooks.short_description = "Books Count" list_display = ['bookname', 'publisher', 'NumberOfBooks'] inlines = [BookInline] So I have a model "Author", as Foreign key to model "Book". I want to count how many books each Author wrote, and display like this on the second level of the admin page Home>Authors>Author: Author | Books Count Someone NumberOfBooks However I get the error: 'Author' object … -
how to make multiple update in django?
I'm trying to make multiple update in django by checking in checkbox then push the update button. this is my view.py def update_kel_stat(request, id, kelid): if request.method == "POST": cursor = connection.cursor() sql = "UPDATE keluargapeg_dipkeluargapeg SET KelStatApprov='3' WHERE (PegUser = %s AND KelID=%s )" % id % kelid cursor.execute(sql) where 'id' is user parameter and 'kelid' is row paramater where 'kelid' become multiple parameter. this is my url.py url(r'^karyawan/update_status/(?P<id>\d+)/(?P<kelid>\d+)/$', views.pesan_update, name='update_pesan') template.html, i use javascript to load url where use to update <script> function setDeleteAction() { if (confirm("Are you sure want to delete these rows?")) { document.kel.action = "{% url 'update_pesan' %}"; document.kel.submit(); } } </script> <form method="post" action="" name="kel" enctype="multipart/form-data"> {% for keluarga in kels %} <tr id="{{ keluarga.KelID }}"> <td> <a href="#">{{ keluarga.KelNamaLengkap }}</a> </td> <td>{{ keluarga.KelHubungan }}</td> <td class="hidden-480">{{ keluarga.KelTglLahir }}</td> <td>{{ keluarga.KelJenisKel }}</td> <td class="hidden-480">{{ keluarga.KelIjazahAkhir }} </td> <td>{{ keluarga.KelPekerjaan }}</td> {% if keluarga.KelStatApprov == '1' %} <td><span class="label label-sm label-danger">Draft</span> </td> {% elif keluarga.KelStatApprov == '2' %} <td> <span class="label label-sm label-warning">Revisi</span> </td> {% elif keluarga.KelStatApprov == '3' %} <td> <span class="label label-sm label-success">Setuju</span> </td> {% endif %} <td>{{ keluarga.KelKetRevisi }}</td> <td> <a href=" {{ MEDIA_URL }}{{ keluarga.KelFileUpload }}">{{ keluarga.KelNamaFile }}</a> </td> <td><input type="checkbox" … -
Django with USE_TZ = False report local time locally but in docker + alpine linux use utc
I have a project in django where USE_TZ = False. When running locally (osx) and use python manage.py shell I get the date in my zone ('America/Bogota'). So, I deploy with docker + alpine linux inside ubuntu (set to the correct timezone): FROM python:3.5-alpine ENV PYTHONUNBUFFERED 1 ENV PRODUCTION 1 ENV TERM xterm ENV LANG es_CO.utf8 RUN mkdir /code WORKDIR /code ADD requirements.txt /code/ RUN apk update && apk add tzdata RUN cp /usr/share/zoneinfo/America/Bogota /etc/localtime RUN echo "America/Bogota" > /etc/timezone RUN apk del tzdata RUN apk add wget py-pip jpeg-dev zlib-dev musl-dev gcc python3-dev "postgresql-dev<9.7" "postgresql-client<9.7" RUN pip install -r requirements.txt RUN apk --purge del build-base postgresql-dev python3-dev musl-dev ADD . /code/ Now I'm getting in the web app the day of tomorrow. So I inspect inside the alpine image: sudo docker exec -ti server_web_1 /bin/sh If I run: /code # date = Thu Nov 24 21:26:56 COT 2016 python import arrow arrow.now() But, if I do: python manage.py shell import arrow arrow.now() But this behaviour doesn't happen in my local machine, neither before when the image was with ubuntu instead of alpine.