Install
Before:
$ sudo apt-get install python-pip python-dev build-essential python3-dev libmysqlclient-dev
$ sudo pip install --upgrade pip
$ pip install virtualenv
$ pip install --upgrade virtualenv
Steps to use virtualenv (go to folder you want to install project):
$ virtualenv --no-site-packages venv
$ virtualenv --no-site-packages -p python3 venv (use version 3 of pyton)
Steps to install django:
$ source bin/activate (activar o virtualenv)
$ pip install Django==1.10.4 ( instalar django)
Steps to install mongo:
$ pip install git+https://github.com/django-nonrel/mongodb-engine
$ pip install -U mongoengine
Steps to install mysql:
$ pip install mysqlclient
$ django-admin startproject refoodSite (Creates a Django project directory structure for the given project name in the current directory or the given destination)
Correr sempre:
$ source venv/bin/activate (activar o virtualenv)
$ python manage.py runserver (run the server)
----
See if everything is ok:
- which django-admin
- which python
----
Follow tutorial: https://docs.djangoproject.com/en/1.10/intro/contributing/
- Steps:
1) It’s a good idea to keep all your virtualenvs in one place, for example
in .virtualenvs/ in your home directory. Create it if it doesn’t exist yet:
$ mkdir ~/.virtualenvs
2) Install:
$ apt-get install python3-venv
$ sudo apt install virtualenv
3) Now create a new virtualenv by running:
$ python3 -m venv ~/.virtualenvs/djangodev
4) The final step in setting up your virtualenv is to activate it:
$ source ~/.virtualenvs/djangodev/bin/activate
5) Before running the test suite, install its dependencies by first cd-ing into the Django tests/ directory and then running:
$ pip install -r requirements/py3.txt
Start with django:
https://realpython.com/learn/start-django/