From 279c87f0278b7d41cde8e2ec9d74f0275be548b7 Mon Sep 17 00:00:00 2001
From: Harouna Diallo
Date: Sun, 27 Jun 2021 18:26:47 +0000
Subject: [PATCH 1/2] Fix static file folder with name
---
MANIFEST.in | 1 -
README.md | 2 ++
docs/features.md | 4 +++-
docs/index.md | 2 ++
docs/tutorial/css-style.md | 1 +
docs/tutorial/index.md | 1 +
docs/tutorial/models.md | 3 +++
docs/tutorial/path-params.md | 1 +
docs/tutorial/post-params.md | 1 +
docs/tutorial/query-params.md | 1 +
examples/awesome_app/app/__init__.py | 0
examples/awesome_app/app/models.py | 1 +
examples/awesome_app/app/tests.py | 1 +
examples/awesome_app/app/views.py | 10 ++++++++++
examples/awesome_app/mask.py | 19 ++++++++++++++++++
examples/awesome_app/settings.py | 1 +
mkdocs.yml | 30 +++-------------------------
nimba/commands/createapp.py | 2 +-
nimba/core/welcom.py | 2 +-
setup.cfg | 2 +-
20 files changed, 53 insertions(+), 32 deletions(-)
create mode 100644 docs/tutorial/css-style.md
create mode 100644 docs/tutorial/models.md
create mode 100644 docs/tutorial/path-params.md
create mode 100644 docs/tutorial/post-params.md
create mode 100644 docs/tutorial/query-params.md
create mode 100644 examples/awesome_app/app/__init__.py
create mode 100644 examples/awesome_app/app/models.py
create mode 100644 examples/awesome_app/app/tests.py
create mode 100644 examples/awesome_app/app/views.py
create mode 100644 examples/awesome_app/mask.py
create mode 100644 examples/awesome_app/settings.py
diff --git a/MANIFEST.in b/MANIFEST.in
index acbb5b6..1893d5b 100644
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -1,6 +1,5 @@
include LICENSE
include README.md
-recursive-include docs *
recursive-include nimba/templates *
recursive-include nimba/staticfiles *
recursive-include scripts *
diff --git a/README.md b/README.md
index db5b916..b2a0325 100644
--- a/README.md
+++ b/README.md
@@ -65,6 +65,8 @@ Quit the server with CONTROL-C.
Open `http://127.0.0.1:8000` in your navigator
![Screenshot](https://github.com/hadpro24/nimba-framework/blob/main/result.png?raw=true)
+continue directly with tutorial
+
## Licence
This project is licensed under the terms of Nimba solution compagny.
diff --git a/docs/features.md b/docs/features.md
index b226316..ec7aee1 100644
--- a/docs/features.md
+++ b/docs/features.md
@@ -1 +1,3 @@
-# Features
\ No newline at end of file
+# Features
+
+Comming soom...
\ No newline at end of file
diff --git a/docs/index.md b/docs/index.md
index e190ab5..0c5c49b 100644
--- a/docs/index.md
+++ b/docs/index.md
@@ -65,6 +65,8 @@ Quit the server with CONTROL-C.
Open `http://127.0.0.1:8000` in your navigator
![Screenshot](https://github.com/hadpro24/nimba-framework/blob/main/result.png?raw=true)
+Continue directly with tutorial
+
## Licence
This project is licensed under the terms of Nimba solution compagny.
diff --git a/docs/tutorial/css-style.md b/docs/tutorial/css-style.md
new file mode 100644
index 0000000..50b210a
--- /dev/null
+++ b/docs/tutorial/css-style.md
@@ -0,0 +1 @@
+# Partie 4 - CSS and JavaScript
\ No newline at end of file
diff --git a/docs/tutorial/index.md b/docs/tutorial/index.md
index e69de29..4744e57 100644
--- a/docs/tutorial/index.md
+++ b/docs/tutorial/index.md
@@ -0,0 +1 @@
+# Parite 1 - Setup
\ No newline at end of file
diff --git a/docs/tutorial/models.md b/docs/tutorial/models.md
new file mode 100644
index 0000000..eedbedc
--- /dev/null
+++ b/docs/tutorial/models.md
@@ -0,0 +1,3 @@
+# Partie 6 - Models
+
+### comming...
\ No newline at end of file
diff --git a/docs/tutorial/path-params.md b/docs/tutorial/path-params.md
new file mode 100644
index 0000000..0b8def4
--- /dev/null
+++ b/docs/tutorial/path-params.md
@@ -0,0 +1 @@
+# Partie 2 - Endpoint
\ No newline at end of file
diff --git a/docs/tutorial/post-params.md b/docs/tutorial/post-params.md
new file mode 100644
index 0000000..898cb14
--- /dev/null
+++ b/docs/tutorial/post-params.md
@@ -0,0 +1 @@
+# Partie 5 - POST data
\ No newline at end of file
diff --git a/docs/tutorial/query-params.md b/docs/tutorial/query-params.md
new file mode 100644
index 0000000..7e77bba
--- /dev/null
+++ b/docs/tutorial/query-params.md
@@ -0,0 +1 @@
+# Partie 3 - Query parameters
\ No newline at end of file
diff --git a/examples/awesome_app/app/__init__.py b/examples/awesome_app/app/__init__.py
new file mode 100644
index 0000000..e69de29
diff --git a/examples/awesome_app/app/models.py b/examples/awesome_app/app/models.py
new file mode 100644
index 0000000..6594757
--- /dev/null
+++ b/examples/awesome_app/app/models.py
@@ -0,0 +1 @@
+#write your models here
\ No newline at end of file
diff --git a/examples/awesome_app/app/tests.py b/examples/awesome_app/app/tests.py
new file mode 100644
index 0000000..759c7bc
--- /dev/null
+++ b/examples/awesome_app/app/tests.py
@@ -0,0 +1 @@
+#write your test here
\ No newline at end of file
diff --git a/examples/awesome_app/app/views.py b/examples/awesome_app/app/views.py
new file mode 100644
index 0000000..719b0e3
--- /dev/null
+++ b/examples/awesome_app/app/views.py
@@ -0,0 +1,10 @@
+from nimba.http import router, render
+
+@router('/')
+def home(request):
+ return "Nimba Framework installed succesfuly!"
+
+
+@router('/about')
+def about(request):
+ return "About form Nimba
"
\ No newline at end of file
diff --git a/examples/awesome_app/mask.py b/examples/awesome_app/mask.py
new file mode 100644
index 0000000..8902563
--- /dev/null
+++ b/examples/awesome_app/mask.py
@@ -0,0 +1,19 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+import pathlib
+import sys
+
+from app.views import * #import your view
+
+def main():
+ try:
+ from nimba.commands import mont_nimba
+ except ImportError as e:
+ raise ImportError(
+ "Couldn't import nimba server. Active your environnement"
+ "or install nimba framework (ex: pip install nimba-framework)"
+ )
+ mont_nimba(sys.argv, pathlib.Path(__file__).parent.absolute())
+
+if __name__ == '__main__':
+ main()
diff --git a/examples/awesome_app/settings.py b/examples/awesome_app/settings.py
new file mode 100644
index 0000000..78cfcda
--- /dev/null
+++ b/examples/awesome_app/settings.py
@@ -0,0 +1 @@
+#all settings application
\ No newline at end of file
diff --git a/mkdocs.yml b/mkdocs.yml
index 5a653f9..74cc31e 100644
--- a/mkdocs.yml
+++ b/mkdocs.yml
@@ -35,32 +35,11 @@ nav:
- features.md
- Tutorial - User Guide:
- tutorial/index.md
- - tutorial/first-steps.md
- tutorial/path-params.md
- tutorial/query-params.md
- - tutorial/body.md
- - Dependencies:
- - tutorial/dependencies/index.md
- - tutorial/dependencies/classes-as-dependencies.md
- - tutorial/dependencies/sub-dependencies.md
- - tutorial/dependencies/dependencies-in-path-operation-decorators.md
- - tutorial/dependencies/global-dependencies.md
- - tutorial/dependencies/dependencies-with-yield.md
- - Security:
- - tutorial/security/index.md
- - tutorial/security/first-steps.md
- - tutorial/security/get-current-user.md
- - tutorial/security/simple-oauth2.md
- - tutorial/security/oauth2-jwt.md
- - tutorial/middleware.md
- - tutorial/cors.md
- - tutorial/sql-databases.md
- - tutorial/bigger-applications.md
- - tutorial/background-tasks.md
- - tutorial/metadata.md
- - tutorial/static-files.md
- - tutorial/testing.md
- - tutorial/debugging.md
+ - tutorial/css-style.md
+ - tutorial/post-params.md
+ - tutorial/models.md
- Advanced User Guide:
- advanced/index.md
- advanced/path-operation-advanced-configuration.md
@@ -83,9 +62,6 @@ nav:
- deployment/index.md
- deployment/versions.md
- deployment/https.md
- - deployment/deta.md
- - deployment/docker.md
- - deployment/manually.md
- contributing.md
- release-notes.md
extra:
diff --git a/nimba/commands/createapp.py b/nimba/commands/createapp.py
index 8521dfd..45fb1e1 100644
--- a/nimba/commands/createapp.py
+++ b/nimba/commands/createapp.py
@@ -77,7 +77,7 @@ def handle(self):
os.makedirs(path_application)
os.makedirs(os.path.join(path_application, 'app'))
os.makedirs(os.path.join(path_application, 'templates'))
- os.makedirs(os.path.join(path_application, 'static'))
+ os.makedirs(os.path.join(path_application, 'staticfiles'))
#init
f = open(os.path.join(path_application, 'app', '__init__.py'), 'w+')
f.close()
diff --git a/nimba/core/welcom.py b/nimba/core/welcom.py
index 9944601..de6e569 100644
--- a/nimba/core/welcom.py
+++ b/nimba/core/welcom.py
@@ -37,7 +37,7 @@
- Thanks Nimba Solution for Licence
+ Thanks Nimba Solution for Licence