Skip to content

Commit c9bd92c

Browse files
update to use codespace (#413)
1 parent 93ede6e commit c9bd92c

File tree

4 files changed

+58
-38
lines changed

4 files changed

+58
-38
lines changed

asciidoc/courses/app-python/course.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
:duration: 7 hours
88
// tag::config[]
99
:repository: neo4j-graphacademy/app-python
10-
:python-version: 3.10.6
10+
:python-version: 3.12
1111
:cypher-repository: neo4j-graphacademy/neoflix-cypher
1212
// end::config[]
1313

asciidoc/courses/app-python/modules/0-setup/lessons/1-setup/lesson.adoc

Lines changed: 54 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,56 @@
55
:lab: {repository-link}
66
:language: Python
77
:disable-cache: true
8+
:branch: main
89

910

10-
include::{shared}/courses/gitpod/introduction.adoc[leveloffset=+2]
11+
You must set up a development environment to run the code examples and exercises.
1112

12-
The repository, link:{repository-link}[github.com/neo4j-graphacademy/app-python^] contains all the starter code and workspace for this course.
13+
include::../../../../../../shared/courses/codespace/get-started.adoc[]
1314

14-
== Explore the Repository
1515

16-
You can open the repository by clicking the link below:
16+
[%collapsible]
17+
.Develop on your local machine
18+
====
19+
You will need link:https://python.org[Python] installed and the ability to install packages using `pip`.
20+
21+
You may want to set up a virtual environment using link:https://docs.python.org/3/library/venv.html[`venv`^] or link:https://virtualenv.pypa.io/en/latest/[`virtualenv`^] to keep your dependencies separate from other projects.
22+
23+
Clone the link:{repository-link}[github.com/neo4j-graphacademy/app-python] repository:
24+
25+
[source,bash]
26+
----
27+
git clone https://github.com/neo4j-graphacademy/app-python
28+
----
29+
30+
Install the required packages using `pip`:
1731

18-
lab::Explore Repository in GitPod[]
32+
[source,bash]
33+
----
34+
cd app-python
35+
pip install -r requirements.txt
36+
----
37+
====
38+
39+
== Setup the environment
40+
41+
Create a copy of the `.env.example` file and name it `.env`.
42+
Update the required values.
43+
44+
[source]
45+
.Create a .env file
46+
----
47+
include::{repository-raw}/{branch}/.env.example[]
48+
----
49+
50+
Update the Neo4j sandbox connection details:
51+
52+
NEO4J_URI:: [copy]#neo4j://{instance-ip}:{instance-boltPort}#
53+
NEO4J_USERNAME:: [copy]#{instance-username}#
54+
NEO4J_PASSWORD:: [copy]#{instance-password}#
55+
56+
57+
== Explore the Repository
1958
2059
Here are some of the important directories in the project:
2160
@@ -26,7 +65,17 @@ Here are some of the important directories in the project:
2665
** `routes/` - Route handlers that are registered on the server. You shouldn't need to edit these files.
2766
* `public/` - Minified build files for the SPA. *Do not edit these files*.
2867
68+
== Run the Application
69+
70+
You can run the application using the following commands:
2971
72+
[source,bash]
73+
.Run the application
74+
----
75+
export FLASK_APP=api
76+
export FLASK_ENV=development
77+
flask run
78+
----
3079
3180
// == Setting Environment Variables
3281
@@ -58,35 +107,6 @@ Here are some of the important directories in the project:
58107
// 7. The username for your Neo4j Sandbox instance
59108
// 8. The password for your Neo4j Sandbox instance
60109
61-
[%collapsible]
62-
.Develop on your local machine
63-
====
64-
You will need link:https://python.org[Python] installed and the ability to install packages using `pip`.
65-
66-
You may want to set up a virtual environment using link:https://docs.python.org/3/library/venv.html[`venv`^] or link:https://virtualenv.pypa.io/en/latest/[`virtualenv`^] to keep your dependencies separate from other projects.
67-
68-
Clone the link:{repository-link}[github.com/neo4j-graphacademy/app-python] repository:
69-
70-
[source,bash]
71-
----
72-
git clone https://github.com/neo4j-graphacademy/app-python
73-
----
74-
75-
Install the required packages using `pip` and download the required data:
76-
77-
[source,bash]
78-
----
79-
cd app-python
80-
pip install -r requirements.txt
81-
----
82-
====
83-
84-
== Course Challenges
85-
86-
For each challenge, you will be provided with a link to re-open the correct file within the repository.
87-
Clicking these links will also set the credentials
88-
load environment variables for your link:https://sandbox.neo4j.com[Neo4j Sandbox^] instance.
89-
90110
== Your Sandbox Instance
91111
92112
include::{shared}/courses/apps/sandbox.adoc[tag="info",leveloffset=+]

asciidoc/courses/app-python/modules/0-setup/lessons/2c-installing-driver/lesson.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Inside `api/neo4j.py`, you will see an `init_driver()` function.
2020
include::{repository-raw}/main/api/neo4j.py[tag=initDriver]
2121
----
2222

23-
lab::Open `api/neo4j.py`[]
23+
Open `api/neo4j.py`.
2424

2525
This function should use the `uri`, `username` and `password` parameters supplied to create an instance of the Neo4j Python Driver.
2626
The driver instance should then be assigned to the `current_app` variable to ensure that it is available throughout the application.
@@ -43,7 +43,7 @@ To do this, we will need to:
4343
2. Import the `GraphDatabase` object from `neo4j` into `neo4j.py`.
4444
3. Create the driver instance with the `uri`, `username` and `password` parameters passed to the function and use the `verify_connectivity()` method to assert that the credentials are correct.
4545

46-
lab::Open `api/neo4j.py`[]
46+
Open `api/neo4j.py`.
4747

4848

4949
=== 1. Install the `neo4j` Dependency

asciidoc/courses/app-python/modules/0-setup/module.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ In the early stages you will learn some of the theory required and then use that
1212
We have built a repository that takes care of the boiler plate, so you can focus on implementing the functionality.
1313

1414

15-
* The project is designed to work with Python version **3.10**
15+
* The project is designed to work with Python version **3.12**
1616
* Packages can be installed with pip
1717
* A web server has been built with link:https://flask.palletsprojects.com/en/2.0.x/[Flask^]
1818
** Authentication is handled with link:https://jwt.io/[JWT Tokens^] and link:https://flask-jwt-extended.readthedocs.io/en/stable/[Flask-JWT-Extended^]

0 commit comments

Comments
 (0)