-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Invoke commands by Makefile
#122
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
<p align="center"> | ||
|
||
<h2 align="center">ZEZERE</h2> | ||
|
||
<p align="center"> | ||
Official Codebase | ||
<br> | ||
<a href="https://github.com/fedora-iot/zezere/issues">Report Bug</a> | ||
· | ||
<a href="https://github.com/fedora-iot/zezere/issues">Request Feature</a> | ||
</p> | ||
</p> | ||
<br> | ||
<p align="center"> | ||
<a href="https://github.com/fedora-iot/zezere/graphs/contributors"> | ||
<img alt="Contributors" src="https://img.shields.io/github/contributors/fedora-iot/zezere.svg?style=for-the-badge" style="max-width:100%;"> | ||
</a> | ||
<a href="https://github.com/fedora-iot/zezere/network/members"> | ||
<img alt="Forks" src="https://img.shields.io/github/forks/fedora-iot/zezere.svg?style=for-the-badge" style="max-width:100%;"> | ||
</a> | ||
<a href="https://github.com/fedora-iot/zezere/stargazers"> | ||
<img alt="Stargazers" src="https://img.shields.io/github/stars/fedora-iot/zezere.svg?style=for-the-badge" style="max-width:100%;"> | ||
</a> | ||
<a href="https://github.com/fedora-iot/zezere/issues"> | ||
<img alt="Issues" src="https://img.shields.io/github/issues/fedora-iot/zezere.svg?style=for-the-badge" style="max-width:100%;"> | ||
</a> | ||
</p> | ||
|
||
## 📝 General Overview | ||
|
||
This file contains the developer guidelines to set up **Fedora Zezere** for Debian-based Linux distributions. | ||
|
||
## ⚙️ Set-Up and Usage | ||
### For Linux (Debian) users: | ||
|
||
- To clone the zezere repository of the project: | ||
``` | ||
git clone https://github.com/fedora-iot/zezere.git . | ||
``` | ||
|
||
- To set-up the virtual environment of the project: | ||
``` | ||
make virtualenv | ||
``` | ||
|
||
- To install the base-dependencies and wsgi configurations of the project: | ||
``` | ||
make dev | ||
``` | ||
- To install other requirements of the project: | ||
``` | ||
make install | ||
``` | ||
- To configure default zezere-manage tool of the project: | ||
``` | ||
make zezere | ||
``` | ||
- To modify the configurations of `zezere.conf` file, manually set: | ||
``` | ||
secret_key = <key generated in .env file> | ||
allowed_host = * | ||
auth_method = local | ||
``` | ||
|
||
- To apply the database migrations and collect staticfiles of the project: | ||
``` | ||
make migrate | ||
``` | ||
- To create the superuser of the project: | ||
``` | ||
make superuser | ||
``` | ||
|
||
- To run the project on the localhost: | ||
``` | ||
make run | ||
``` | ||
***Note:*** _As of now, `zezere.conf` file modifications are supposed to be done manually, however, the work is in progress to invoke them by `make` commands_ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
PYTHON_EXE?=python3 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Any reason you're using Makefile for this? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Facing issues while setting up a project is quite inevitable. To simplify the process, make commands might be invoked after specifying the tasks to be executed. |
||
MANAGE=venv/bin/python manage.py | ||
ACTIVATE?=. venv/bin/activate; | ||
GET_SECRET_KEY=`base64 /dev/urandom | head -c50` | ||
ENV_FILE=.env | ||
|
||
PORT = 8080 | ||
|
||
virtualenv: | ||
@echo "-> Making Virtual Environment" | ||
@${PYTHON_EXE} -m venv venv | ||
|
||
genkey: virtualenv | ||
@echo "-> Generating Secret key" | ||
@if test -f ${ENV_FILE}; then echo ".env file exists already"; true; else \ | ||
mkdir -p $(shell dirname ${ENV_FILE}) && touch ${ENV_FILE}; \ | ||
echo secret_key=\"${GET_SECRET_KEY}\" > ${ENV_FILE}; \ | ||
cat etc/env.txt >> ${ENV_FILE}; fi | ||
|
||
dev: genkey | ||
@echo "-> Installing Dependencies" | ||
@${ACTIVATE} pip install -r etc/dev.txt | ||
@${ACTIVATE}mod_wsgi-express start-server | ||
|
||
|
||
install: genkey | ||
@echo "-> Installing Dependencies" | ||
@${ACTIVATE} pip install . | ||
|
||
zezere: | ||
@${ACTIVATE} cp zezere/default.conf ./zezere.conf | ||
|
||
migrate: | ||
@echo "-> Creating database file" | ||
@${MANAGE} migrate --noinput | ||
@echo "-> Collecting static file" | ||
@${MANAGE} collectstatic | ||
|
||
superuser: | ||
@${ACTIVATE} zezere-manage createsuperuser --username admin --email [email protected] | ||
|
||
run: | ||
./app.sh |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
django>=2.1 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why create a separate requirements file and not use the project-level one? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We can use the project-level requirements file for sure. No doubt that right now it does not serve any major purpose but as the size of the source code grows with the passage of time, specifying separate dependencies for production and development seems more reasonable. Moreover, in the case of working with unit testing frameworks, installing that in production would be unavailing. |
||
djangorestframework | ||
mod_wsgi-standalone | ||
psycopg2-binary | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what are these for? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I was going by the common convention to put testing or development requirements in a separate file. The basic idea behind this was to install all developmental dependencies by invoking make commands in that respective directory. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
any reason for not using markdown specifically? 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using regular HTML tags comes in handy while specifying the dimensions of an image. Rest, nothing specific.