Skip to content
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

How to build from source and start a local server? #143

Closed
niltonvasques opened this issue Apr 21, 2021 · 5 comments
Closed

How to build from source and start a local server? #143

niltonvasques opened this issue Apr 21, 2021 · 5 comments

Comments

@niltonvasques
Copy link

niltonvasques commented Apr 21, 2021

Hello guys,

I'm trying to customize a bit the app, but after several tries, I could not figure out the right way to do it.

I tried with the following commands:

pip install -r dev-requirements.txt
apt install uglifyjs -y
pip install shiv
doit build
doit build_pyz
python setup.py install

python dist/zerobin.pyz --host 0.0.0.0 --port 3260

The app starts, however the modifications that I made are not applied.

I performed a small change to style.css, but I cant make it propate to the app after the build.

@ksamuel
Copy link
Collaborator

ksamuel commented Apr 21, 2021

What CSS files are served when you look at the HTML source from the browser ?

@niltonvasques
Copy link
Author

niltonvasques commented Apr 23, 2021

After all this commands I performed a find to search all the CSS files in the system and looks like that there is an outdated css in the shiv folder. See:

root@a6935bdf18bd:/data# find / -name *style.min* | xargs -I {} md5sum {}
19b6007eda23496c402ef3248edae316  /root/.shiv/zerobin_cf8a10b0db2f8aaaa91e3e01c9575ba6faddea9598b83a5621cae2514477937f/site-packages/zerobin/static/css/style.min.css
4e1ddc3a4a04a69f0553fd09d861dad0  /usr/local/lib/python3.7/site-packages/zerobin-2.0.0-py3.7.egg/zerobin/static/css/style.min.css
4e1ddc3a4a04a69f0553fd09d861dad0  /data/build/lib/zerobin/static/css/style.min.css
4e1ddc3a4a04a69f0553fd09d861dad0  /data/zerobin/static/css/style.min.css

Thes first one is served to the browser. See:

root@a6935bdf18bd:/tmp$ curl -s http://localhost:3260/static/css/style.min.css?1.0.5 | md5sum
19b6007eda23496c402ef3248edae316  -

Same problem happens if I changed the python scripts or the .tpl templates from views folder.

@niltonvasques
Copy link
Author

Any idea from what could be happening @ksamuel ?

@revij
Copy link

revij commented May 2, 2021

@niltonvasques Try this:

rm -rf build
rm -rf dist
python setup.py build
python setup.py install

zerobin --host 0.0.0.0 --port 3260

Also, based on the utils.py under the zerobin folder, it will create a .config folder on your home directory, from where it will read the settings.

@niltonvasques
Copy link
Author

Flawless working @revij ! 💯 Thanks a lot dude! 🍻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants