43 questions
1
vote
0
answers
59
views
Django: exception in get_catalog()
I have a limited set of LANGUAGES:
LANGUAGE_CODE='sl' # It's for locals first of all
LANGUAGES=[
('sl', _('Slovene')), # First is default
('en', _('English')),
('it', _('Italian')),
('...
0
votes
1
answer
154
views
ModuleNotFoundError: No module named 'django_countries '
import uuid
from django.db import models
from django.db.models import Sum
from django.conf import settings
from django_countries.fields import CountryField
from product.models import Product, ...
0
votes
1
answer
127
views
How to use alpha3 country code in django model CountryField
Let's say I have a form that can be filled out by a user with personal details, such as
class PersonForm(ModelFormSansSuffix):
class Meta:
model=Person
fields=["name", "...
1
vote
1
answer
169
views
How do you implement the "COUNTRIES_ONLY" setting in django_countries?
I'm new to Django and have a model that takes in user address details. I'm using a CourtryField and only want to display four country options in the form on the user profile template. I believe that I ...
4
votes
1
answer
2k
views
How to serialize a CountryField from django-countries?
I'm trying to add the CountryField to a serializer for the Register process (using dj-rest-auth) and can't find the correct way to implement it.
All the answers I found just say to use what the ...
0
votes
1
answer
751
views
Django Countries - unable to pre-select the right country in an edit form
Consider this model:
class Address(models.Model):
line1 = models.CharField(max_length=255, db_index=True, blank=True, null=True)
city = models.CharField(max_length=255, db_index=True, blank=...
1
vote
0
answers
188
views
Django CountrySelectWidget not working when Debug=False
I am using Django Countries and the CountrySelectWidget to show the country flag after the CountryField on my form.
This works fine when Debug is set to True and I can see the flag fine. However when ...
0
votes
1
answer
3k
views
how to use country name as default instead of code in django-countries package
I am using an a django package called django-countries which gives me access to some countries attributes in the world such as country name, country code, country flag and some other more.
It seems ...
0
votes
1
answer
932
views
Django fails upon server startup trying to import module ("doesn't look like a module path")
Seems I'm following the instructions, but somehow Django doesn't see django_countries as an app.
Error:
System check identified no issues (0 silenced).
February 18, 2021 - 23:56:01
Django version 3.1....
2
votes
1
answer
7k
views
ModuleNotFoundError: No module named 'django_countries'
I have a docker django project and I want to use django-countries.
This is my requirements.txt
....
django-countries
django-cities
This is the INSTALLED_APPS in settings.py file
INSTALLED_APPS = [
...
1
vote
1
answer
1k
views
filter queryset based on django countries field
this is my viewset:
class PollViewSet(viewsets.ReadOnlyModelViewSet):
queryset = Poll.objects.all()
serializer_class = PollSerializer()
def get_queryset(self):
country = self....
0
votes
1
answer
417
views
LookupError: No installed app with label "admin"
So I'm trying to run my development server using the command "python manage.py runserver"
But whenever I try to run it, it gives me this error;
Watching for file changes with StatReloader
Exception ...
2
votes
1
answer
3k
views
Error running WSGI application, ModuleNotFoundError: No module named 'django_countries'
I'm trying to deploy my webApp on PythonAnywhere but the following error occour:
2019-10-01 18:20:12,820: Error running WSGI application
2019-10-01 18:20:12,928: ModuleNotFoundError: No module named '...
0
votes
1
answer
517
views
How to use the verbose name of a language choice in Django-Countries with Django Filter
I have this Django Filter:
from django_countries.data import COUNTRIES
owner__nationality = filters.MultipleChoiceFilter(choices=COUNTRIES, widget=Select2MultipleWidget)
So I guessed I just use the ...
2
votes
1
answer
1k
views
How to add a class to the Django countries widget
Hi I am trying to use a Django plugin called django-countries to add a select with all the countries, sofar It's working but how can I add a html class to the select?