Skip to content

Commit b9d4d96

Browse files
Yaroslav SmirnovYaroslav Smirnov
authored andcommitted
initial commit
0 parents  commit b9d4d96

34 files changed

Lines changed: 37439 additions & 0 deletions

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
google-python-exercises/
2+
.idea/
3+
python-trading/excel/
4+
python-trading/oanda_api.py
5+
python_fundamentals/prank/

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# python_steps
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
Installing the Vagrant VM for Full Stack Foundations
2+
You will use a virtual machine (VM) for all of the activities in this course. The VM is a Linux server system that runs on top of your own computer. You can share files easily between your computer and the VM. I strongly recommend running all of your code on a VM to prevent modifications of any important files on your computer.
3+
4+
We're using the Vagrant software to configure and manage the VM. Here are the tools you'll need to install to get it running:
5+
6+
Note: If you have already setup the vagrant VM from the Udacity course for Relational Databases (ud197) you do not need to do any further setup
7+
8+
Git
9+
10+
If you don't already have Git installed, download Git from git-scm.com. Install the version for your operating system.
11+
12+
On Windows, Git will provide you with a Unix-style terminal and shell (Git Bash).
13+
(On Mac or Linux systems you can use the regular terminal program.)
14+
15+
You will need Git to install the configuration for the VM. If you'd like to learn more about Git, take a look at our course about Git and Github.
16+
17+
VirtualBox
18+
19+
VirtualBox is the software that actually runs the VM. You can download it from virtualbox.org, here. Install the platform package for your operating system. You do not need the extension pack or the SDK.
20+
21+
Vagrant
22+
23+
Vagrant is the software that configures the VM and lets you share files between your host computer and the VM's filesystem. You can download it from vagrantup.com. Install the version for your operating system.
24+
25+
Use Git to fork, then clone, the VM configuration
26+
27+
Windows: Use the Git Bash program (installed with Git) to get a Unix-style terminal.
28+
Other systems: Use your favorite terminal program.
29+
30+
Log into your personal Github account, and then navigate to the fullstack-nanodegree-vm. Next, fork the fullstack-nanodegree-vm so that you have a personal repo you can push to for backup. Later, you'll be able to use this repo for submitting your projects for review as well.
31+
32+
From the terminal, run:
33+
34+
git clone http://github.com/<username>/fullstack-nanodegree-vm fullstack
35+
This will give you a directory named fullstack that is a clone of your remote fullstack-nanodegree-vm repository. Be sure to replace your username.
36+
37+
Run the virtual machine!
38+
39+
Using the terminal, change directory to fullstack/vagrant (cd fullstack/vagrant), then type vagrant up to launch your virtual machine.
40+
41+
Once it is up and running, type vagrant ssh to log into it. This will log your terminal in to the virtual machine, and you'll get a Linux shell prompt. When you want to log out, type exit at the shell prompt. To turn the virtual machine off (without deleting anything), type vagrant halt. If you do this, you'll need to run vagrant up again before you can log into it. Be sure to change to the /vagrant directory by typing cd /vagrant in order to share files between your home machine and the VM.
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
import sys
2+
3+
from sqlalchemy import Column, ForeignKey, Integer, String
4+
5+
from sqlalchemy.ext.declarative import declarative_base
6+
7+
from sqlalchemy.orm import relationship
8+
9+
from sqlalchemy import create_engine
10+
11+
Base = declarative_base()
12+
13+
14+
class Restaurant(Base):
15+
__tablename__ = "restaurant"
16+
name = Column(String(80), nullable = False)
17+
id = Column(Integer, primary_key = True)
18+
19+
20+
21+
class MenuItem(Base):
22+
__tablename__ = "menu_item"
23+
name = Column(String(80), nullable = False)
24+
id = Column(Integer, primary_key = True)
25+
course = Column(String(250))
26+
description = Column(String(250))
27+
price = Column(String(8))
28+
restaurant_id = Column(Integer, ForeignKey("restaurant.id"))
29+
restaurant = relationship(Restaurant)
30+
31+
32+
33+
34+
### insert at the end of the file ###
35+
36+
engine = create_engine("sqlite:///restaurantmenu.db")
37+
38+
Base.metadata.create_all(engine)

0 commit comments

Comments
 (0)