-
Notifications
You must be signed in to change notification settings - Fork 0
Getting Started
Here is how we got started...
At first we created accounts (from the presentations) and installed Git Bash, Python, PyCharm, and XAMPP.
-
Git Bash: If you create an account on GitHub, you'll be able to save your code changes through a Version Control System (VCS) Git. For Windows, Git Bash provides the command-line tool
git, which allows us to track file system changes using Git, which in turn, will allow seamless collaboration in a group by syncing the changes with one another. The other tool,bashprovides the command line interface to makegitwork. It comes in with a Command Prompt-like interface. Here's a screenshot of Git Bash:
-
Python: We'll be using Python for our "backend", while using HTML, CSS and JavaScript for "frontend". Python is a programming language which we will be using to build our "web server."
-
PyCharm: To edit Python files as well as HTML/CSS/JavaScript files, we will be using PyCharm, a smart Integrated Development Environment (IDE) for this project.
-
XAMPP: XAMPP stands for Cross-platform(X), Apache, MySQL, PHP, and Perl. We'll be using MySQL as our database, and we'll also need to use Apache to use a program named as
phpMyAdmin, an interface to control MySQL database server. Usually,phpMyAdminrests at the URL http://localhost/phpmyadmin (this will only work if you start Apache and MySQL in XAMPP Control Panel. More on that later.)
These were some basic things to be known before we go any further.
Now moving on with the steps,
-
At first, we opened the Gitbash terminal and typed
git clone https://github.com/CodeSlammers/python-base.git my_project
(This step made a copy of the repository in our computer.) -
We then, opened Xamp and started Apache and MySQL.
-
We opened the cmd prompt and typed
cd my project(Enter)
(In next line, we typed)python -m pip install – r requirements.txt
(The first step opens the cloned repository and the second installs the dependencies such as flask(web framework written in Python) and SQlAlchemy associates user defined classes and databases) -
We then, opened Pycharm and opened the same project.
-
After that, we opened
localhost/phpmyadminand created a database. -
Then on a new browser tab, going to http://localhost:5000/app, we opened the default page.
-
One thing to be noted is that we start the Apache and MySQl to record the changes we make in the file otherwise the route(URL) shows the content even without starting them.
-
The route are assigned in the
home.pypage under frontend section of the repository. -
In order to get started with making the page , we should click the template > create new HTML file.
That will give us a new page. -
Then inorder to view it on the browser, (like I wrote earlier) we have to go to the home.py of frond end and write the following instruction
@frontend_app.route(‘/samplepage123’)
def sample():
return render_template(‘sample_page.html’)
Here the(/samplepage123)is the route which will lead us to the page(‘sample_page.html’)and controller is the whole URL.
Code Slammers, 2018. Program run by Damodar Dahal <damodar[dot]dahal[at]selu[dot]edu>. All contents provided under the MIT License.