Last active
June 22, 2017 15:37
-
-
Save hugopereira84/a74568407aa1d547f66ff6adcd4a3408 to your computer and use it in GitHub Desktop.
Install
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Start with django: | |
https://realpython.com/learn/start-django/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment