# django with python3



## coyote_zed (Sep 18, 2017)

I'm trying to setup my home server as a test webserver and would like to install django (using python3). I only saw django listed py27 section. I am relatively new to both django and Freebsd and was wondering if I need to use pip from python3 to install django or if I should use the packages from the repo. I am currently running FreeBSD 11.1 and have installed the Python3 pkg that ends up being Python 3.6.1. Any help would be greatly appreciated.


----------



## SirDice (Sep 18, 2017)

The official packages are always built using the default options. Which, in this case, means Python 2.7. If you want to deviate from the defaults you're going to have to build from ports. I'm not sure if this is going to work but you can add to /etc/make.conf:

```
DEFAULT_VERSIONS+=python=3.6
```
Note however that this may cause serious incompatibility issues with various other Python based ports.


----------



## coyote_zed (Sep 18, 2017)

Is there a way to do this without the potential for causing compatibility issues? I read about setting up a python virtual environment, but was unsure if/how this would effect my ability to connect to a database or webserver functionality.


----------



## JeremyA (Nov 29, 2017)

Another option is to install Django with pip.

`pip-3.6 install django`


----------

