quantim

Django Set Up

Apr 16th, 2016
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.93 KB | None | 0 0
  1. Setting Up Django:
  2.  
  3. The commands and tools necessary to set up the Django Web Framework on an Ubuntu 14.04 system. Things like the initial download, setting up a remote Git repository, and Bootstrap are covered.
  4.  
  5. Install the following packages globally, as well as making sure you have the latest version of pip.
  6. $ sudo apt-get install python3-pip git mariadb-server
  7. $ pip3 install --upgrade pip
  8. $ sudo pip3 install virtualenv
  9.  
  10. Create a coding directory, and set it up
  11. $ mkdir ~/project/
  12. $ cd ~/project/
  13. $ virtualenv --no-site-packages -p python3 env
  14. $ git init
  15.  
  16. # Activate (start using the virtualenv)
  17. $ . ./env/bin/activate
  18. # Check you are using the virtualenv python with "which python"
  19.  
  20. # Make sure you have the latest pip!
  21. $ pip install django
  22. $ pip install mysqlclient
  23. # Create the initial requirements file
  24. $ pip freeze > requirements.txt
  25.  
  26. # Now Actually create the Django project, then the app.
  27. $ django-admin startproject mysite
  28. $ cd mysite
  29. $ ./manage.py startapp siteapp
  30.  
  31. # Set up git and the remote git repository
  32. $ git config --global user.name "Timothy Pulliam"
  33. $ git config --global user.email "[email protected]"
  34. $ git config --global core.editor vim
  35. $ git config --list
  36.  
  37. # Create a remote repository on Github.
  38. $ git remote add origin https://github.com/Timothy-Pulliam/mysite
  39.  
  40. # Now would be a good time to commit the initial state of the project.
  41. $ git add .
  42. $ git commit -m "Initial Commit for mysite and siteapp"
  43. $ git push origin master
  44.  
  45. # Install Bootstrap files into your app's static directory
  46. http://pastebin.com/edit/M0ma6L5J
  47.  
  48. # The last thing we need to do is set up the data base engine Django will use for the back end. Django
  49. # Uses Sqlite3 by default, however this is not entirely scalable so we will be using MariaDB (FOSS fork of MySQL).
  50. # For information on how to do this, see the following link,
  51. https://github.com/Timothy-Pulliam/Notes/blob/master/Django%20Notes/database_setup
Add Comment
Please, Sign In to add comment