Trying to add Django Countries to Django

前端 未结 3 1346
终归单人心
终归单人心 2021-01-29 06:14

I am a newbie to django and I am trying to install django countries and am haveing issues. I Installed from http://pypi.python.org/pypi/django-countries/1.0.1. When I installe

相关标签:
3条回答
  • 2021-01-29 06:43

    You can install django countries with this command:

    sudo pip install django-countries
    

    Then your INSTALLED_APPS should be updated like this:

    INSTALLED_APPS = (
        'django_admin_bootstrapped.bootstrap3',
        ...
        'django.contrib.staticfiles',
        ...
        'django_countries',
    )
    

    (note: no django. prefix, countries spelt correctly, underscore not dash)

    BTW I found this command useful when verifying package names:

    pip list
    
    0 讨论(0)
  • 2021-01-29 06:48

    If this version was downloaded from google, it looks like the app is in a subfolder called countries. Put this folder in your python dist-packages folder so the path is /usr/local/lib/python2.7/dist-packages/countries and then add countries to the list of installed apps. See this doc for more details http://code.google.com/p/django-countries/source/browse/trunk/INSTALL.txt

    0 讨论(0)
  • 2021-01-29 06:56

    Why did you put it into django.contrib? That's for apps that are supplied with Django.

    Install it properly, into its own directory. Then, fix the spelling error you have made in INSTALLED_APPS: countries, not counties.

    0 讨论(0)
提交回复
热议问题