Giter Club home page Giter Club logo

django-clean-template's Introduction

Это чистый шаблон Django проекта, с которым можно быстро начать разработку. В шаблон входит конфиг Systemd, nginx, gunicorn.

Видео

Установка представляет собой просто указание Python интерпретатора и названия домена, запустите:

./install.sh

В конфиге Django заполните настройки базы данных (src/config/settings.py).

Посмотреть статус gunicorn демона:

sudo systemctl status gunicorn

Логи gunicorn'а лежат в gunicorn/access.log и gunicorn/error.log.

После изменения systemd конфига надо перечитать его и затем перезапустить юнит:

sudo systemctl daemon-reload
sudo systemctl restart gunicorn

django-clean-template's People

Contributors

alexey-goloburdin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

django-clean-template's Issues

проблема с pip и psycorg

в install.sh установка пакетов идет через pip(python2.x) , а не через pip3 (python3.x) и в requirements.txt указан psycorg2 с которым могут возникнуть проблемы при установке , может лучше использовать уже скомпилированный psycopg2-binary?

install.sh file concern

Hello there,

I have used some LOCs of install.sh file and my observation regarding this file's content you can fid below. By the way, thanks a lot for sharing useful code samples.

In case of using install.sh it will OK only for the first deployment. Explanation: as soon as you will pull your projects updates from github for instance, it will overwrite files in systemd and nginx folders. So far in those folders files are links for files in /etc/systemd/system/ and /etc/nginx/sites-enabled/ means at this moment they will link to files which contains $project_path variable. Thus services won't work.

Please correct me if I'm wrong.

Regards

не собираются и не читаются статические файлы

не собирались статик файлы, добавил в src/config/settings.py
STATIC_ROOT = "/var/www/uvom.pp.ua/static/" и создал директорию
статик файлы собрались в эту директорию, но при попытке зайти в админку стили не прочитались, в логе nginx увидил
2024/01/31 14:55:14 [error] 10618#10618: *4 open() "/var/www/uvom.pp.ua/static/static/admin/css/base.css" failed (2: No such file or directory)
ищет не по тому пути
в конфиге nginx/site.conf
location /static/ {
root /var/www/uvom.pp.ua/static;

заменил на
location /static/ {
root /var/www/uvom.pp.ua;

после перезапуска gunicorn и nginx статические файлы стали искаться по правильному пути

Что-то пошло не так...

Алексей, добрый день.
Не могу воспользоваться Вашим классным шаблоном. Скрипт выполняется наполовину, и посреди возвращается ошибка и много красного текста:

`ERROR: Command errored out with exit status 1:
command: /home/www/code/app/env/bin/python3.9 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-g71i1grg/psycopg2/setup.py'"'"'; file='"'"'/tmp/pip-install-g71i1grg/psycopg2/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-5lsq5wbh
cwd: /tmp/pip-install-g71i1grg/psycopg2/
Complete output (23 lines):
running egg_info
creating /tmp/pip-pip-egg-info-5lsq5wbh/psycopg2.egg-info
writing /tmp/pip-pip-egg-info-5lsq5wbh/psycopg2.egg-info/PKG-INFO
writing dependency_links to /tmp/pip-pip-egg-info-5lsq5wbh/psycopg2.egg-info/dependency_links.txt
writing top-level names to /tmp/pip-pip-egg-info-5lsq5wbh/psycopg2.egg-info/top_level.txt
writing manifest file '/tmp/pip-pip-egg-info-5lsq5wbh/psycopg2.egg-info/SOURCES.txt'

Error: pg_config executable not found.

pg_config is required to build psycopg2 from source.  Please add the directory
containing pg_config to the $PATH or specify the full executable path with the
option:

    python setup.py build_ext --pg-config /path/to/pg_config build ...

or with the pg_config option in 'setup.cfg'.

If you prefer to avoid building psycopg2 from source, please install the PyPI
'psycopg2-binary' package instead.

For further information please check the 'doc/src/install.rst' file (also at
<http://initd.org/psycopg/docs/install.html>).

----------------------------------------

ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.`

С уважением,
Максим

PS. Иду следом по Вашему видео "Scalable"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.