Skip to content

Commit

Permalink
Setup (#10)
Browse files Browse the repository at this point in the history
* reorganized the folders, created the initial setup, and created the base html

* added the make live command

* fixed missing the command in PHONY

* Created pipeline for CI, fixed the requirements of the project and make a new test for testing CI

* Created pipeline for CI, fixed the requirements of the project and make a new test for testing CI

* Fixed the error of requirements.test.txt and removed livereload untill find a way to use it with tests

* Fixed the error of missing pflake on requirements

* Fixed the test, removed --forked from test

* Configured a new Hot Reload for front-end
  • Loading branch information
vmagueta authored Jan 6, 2025
1 parent 5aac156 commit d18b4c0
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 20 deletions.
11 changes: 1 addition & 10 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,31 +1,22 @@
PHONY: install run virtualenv ipython clean test pflake8 fmt lint live

PHONY: install run virtualenv ipython clean test pflake8 fmt lint

install:
@echo "Installing for dev environment"
@.venv/bin/python -m pip install -e '.[test,dev]'


virtualenv:
@python -m venv .venv


live:
@python manage.py livereload


run:
@python manage.py runserver


ipython:
@.venv/bin/ipython


test:
@.venv/bin/pytest -vs -s


lint:
@.venv/bin/pflake8 app kamila_project

Expand Down
5 changes: 2 additions & 3 deletions kamila_project/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
For the full list of settings and their values, see
https://docs.djangoproject.com/en/5.1/ref/settings/
"""

from pathlib import Path

# Build paths inside the project like this: BASE_DIR / 'subdir'.
Expand Down Expand Up @@ -40,7 +39,7 @@
"django.contrib.messages",
"django.contrib.staticfiles",
"app",
# "livereload",
"django_browser_reload",
]

MIDDLEWARE = [
Expand All @@ -51,7 +50,7 @@
"django.contrib.auth.middleware.AuthenticationMiddleware",
"django.contrib.messages.middleware.MessageMiddleware",
"django.middleware.clickjacking.XFrameOptionsMiddleware",
# "livereload.middleware.LiveReloadScript",
"django_browser_reload.middleware.BrowserReloadMiddleware",
]

ROOT_URLCONF = "kamila_project.urls"
Expand Down
2 changes: 2 additions & 0 deletions kamila_project/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@
from django.urls import path

from app import views
from django.urls import include, path

urlpatterns = [
path("post/", views.post, name="post"),
path("blog/", views.blog, name="blog"),
path("index/", views.index, name="index"),
path("admin/", admin.site.urls),
path("", views.index, name="index"),
path("__reload__/", include("django_browser_reload.urls")),
]
3 changes: 1 addition & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,14 @@ dependencies = [
[tool.setuptools.packages]
find = { where = ["app", "kamila_project"] }


[project.optional-dependencies]
test = [
"flake8",
"black",
"isort",
"pytest",
"pytest-django",
# "livereload",
"django-browser-reload",
]

[tool.flake8]
Expand Down
7 changes: 2 additions & 5 deletions requirements.dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,8 @@ pudb
pytest
pytest-watch


# auto reload
# django-livereload
# django-livereload-server

# auto reload front-end
django-browser-reload

# Code Quality
flake8
Expand Down

0 comments on commit d18b4c0

Please # to comment.