Branch: refs/heads/master Author: Enrico Tröger enrico.troeger@uvena.de Committer: Enrico Tröger enrico.troeger@uvena.de Date: Sun, 01 Nov 2015 22:52:26 UTC Commit: 7f6df319c1c9d2393014b0e013d8396b03555bbf https://github.com/geany/www.geany.org/commit/7f6df319c1c9d2393014b0e013d839...
Log Message: ----------- Update setup instructions for development environment
Also document existing management commands and set mysqlclient as MySQL driver requirement as it is more actively maintained than MySQL-python and also is compatible with Python 3.
Modified Paths: -------------- README.dev.md requirements.txt
Modified: README.dev.md 61 lines changed, 54 insertions(+), 7 deletions(-) =================================================================== @@ -46,16 +46,14 @@ Change into the freshly cloned repository directory and execute the following co to create a new virtualenv and install required Python packages:
export PIP_REQUIRE_VIRTUALENV=true - export VIRTUALENV_USE_DISTRIBUTE=true - export VIRTUALENV_NO_SITE_PACKAGES=true
- virtualenv --distribute --no-site-packages venv + virtualenv venv # activate virtual environment source venv/bin/activate # upgrade some packages, just to be safe - pip install --upgrade pip distribute + pip install --upgrade pip setuptools # very helpful tool to manage packages in addition to pip - pip install yolk + pip install git+git://github.com/eht16/yolk#egg=yolk # install our requirements pip install -r requirements.txt
@@ -113,7 +111,7 @@ the settings to your needs: SSL_FORCE_URL_PREFIXES = ()
-### Database settings ### +### Database settings
The above example configures a MySQL database connection. For local development you can also use Sqlite which is simpler @@ -124,7 +122,13 @@ Whatever database you use, ask Enrico to get a dump of a demo database to get something to work with. This dump can be easily imported into a configured database with the following command:
- python manage.py loaddata geany_dump.fixture + python manage.py reset_db + python manage.py migrate --no-initial-data + echo 'TRUNCATE auth_permission; \ + TRUNCATE django_content_type; \ + TRUNCATE django_site;' | python manage.py dbshell + python manage.py createsuperuser + python manage.py loaddata database.json
Start the development server @@ -163,6 +167,49 @@ to reload the changed file(s). This is very helpful. To stop the server, simply interrupt it with *Ctrl-C*.
+Management Commands +----------------------- + +In addition to the usual Django management commands (for a +list run `python manage.py`), the Geany apps provide a few more. + +### manage.py dump_database + +This command will dump the configured database to a file +named `database.json` in the current directory. +The generated dump is not a SQL dump but consists of JSON +objects of all models known to Django. Only a few models +are excluded: + + * `auth.user` (excluded for privacy reasons) + * `sessions.session` (excluded for privacy reasons) + * `admin.logentry` (excluded for privacy reasons) + * `pastebin.snippet` (might be much data) + +The resulting dump might be used to populate a development +environment from scratch and is also committed to the +repository for general availability. + + +### manage.py cleanup_snippets + +Clean all expired snippets in the integrated Pastebin app. +Usually, you don't need to call this command as expired +snippets will be cleaned automatically when the snippet list +is accessed via the website. + + +### manage.py generate_snippets_css + +Update the necessary CSS classes for displaying snippet +highlighting in the Pastebin app. +The CSS classes are generated by Pygments which is used +for highlighting the snippet code in HTML. + +Call this command after updates of the Pygments package and +then commit the updated CSS file `pastebin/static/css/pygments.css`. + + Special hostnames / DNS -----------------------
Modified: requirements.txt 2 lines changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -1,5 +1,5 @@ Mezzanine -MySQL-python +mysqlclient django-compressor django-extensions django-honeypot
-------------- This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).