How to override river-admin template? - django

Firstly , i would like to say that this package is amazing in the sense where there can be so much flexibility. Im relatively new to this package and im just trying to figure a way to fiddle around with the provided front end in the river-admin package. Could someone point me in the correct direction in doing so?

I am the author of both django-river and river-admin.
river-admin is an admin interface for django-river implemented as a Vue.js application backed by django-rest-framework.
One fact about it is that it was never meant to use the river-admin as an extension to your django app which means that it doesn't have to fit in how your own django app looks. You might think of it is like the UI of Apache Airflow or RabbitMQ admin interface and so on.
But if you think that the things you wanna add are something that can be used by all of its other users why not contribute to the repo. Otherwise, you can always fork the repo and do the custom changes that you can not do via the river-admin API, build the package by yourself.
Here is some information on how one can build and run stuff locally

Related

How to use django as backend for cordova?

Not a web developer, but currently playing with cordova and would like to use django to use python to implement backend functionality. As I (vaguely) understand it, cordova manages frontend stuff and django is mostly for backend stuff. So is it possible to use django as a backend for a cordova project (eg. directly use preexisting django templates in a cordova app)? If so, how? Is there some kind of special communicationn that I'd need to code myself?
(My uneducated guess would be to initialize the django project inside the cordova www folder, but this seems wrong). And if this is a totally wrong way to think about this problem, let me know.
You could use Django as your backend and implement a REST like API (urls that accept and return JSON data) in it. There are useful tools/libraries for that, for example django-rest-framework.
Then you would call those endpoints (URLs) from your frontend, which can be written in cordova or any other JS frontend frameworks.
As you already pointed out, I suggest keeping frontend and backend code in separate folders.

Share NodeJS Apps like Django

I come from a Django background, where to add functionality to the site you make an app. You can share that app between other Django projects.
In the Node world I haven't really seen anything like this. However, I want to write code that is reusable and useful to the community. So I'm wondering:
Do Node programmers share apps?
How would I structure an app so that it would be easy for someone to add to their site?
Node.js developers share functional packages of code called modules through the npm registry. The modules are used the same way as the modules shown in the documentation, and are typically utilized with require(). However, do take note that Django is a web framework, and Node is a programming language. Node is to Python as something like Express would be to Django.
There isn't any specific way to structure a Node module. You just need to make sure that the package.json file is configured correctly so that the module can download any dependencies, set any binaries, and do general setup correctly.

How to migrate Django project to Google App Engine

I am looking for a guide to migrate Django project to Google App Engine and use Google's datastore. The most of the guides I found were linked to Django-Appengine using Django-nonrel (but I want to use GAE's native support).
Going through GAE getting started guide, it says:
Google App Engine supports any framework written in pure Python that speaks CGI (and any WSGI-compliant framework using a CGI adaptor), including Django, CherryPy, Pylons, web.py, and web2py. You can bundle a framework of your choosing with your application code by copying its code into your application directory.
I understand that I won't be able to use some features of Django in that case (majorly the admin feature) and would also need to restructure the models.
From other reading, I also found that latest SDK of GAE now includes Django 1.3 on Python 2.5.
I tried to put all files from my Django application to a GAE project, but couldn't get it all to work together.
Please provide some basic guide using which I may migrate my Django project to Google App Engine's code.
Thanks.
For an existing Django app, using django-nonrel is the simplest approach; it is very popular so you should be able to find help with specific errors you get quickly.
Another approach is written up in this article: http://code.google.com/appengine/articles/pure_django.html -- it goes the other way, taking an App Engine app that uses Django for dispatch, templates, and forms, but not for models, and describes how to make it run in a native Django environment. Maybe you can glean some useful hints for your situation from it.
I've used django-nonrel, which behaves pretty much like django, except that operations with JOINs will return errors. I've basically worked around this by avoiding ManyToMany fields, and essentially building that functionality manually with an intermediate table.
So far I've ran into two problems with Django-nonrel:
1. No access to ancestor queries, which can be run in a transaction. There's a pending pull request for this feature though.
2. You can't specify fields that are not indexed. This could significantly increase your write costs. I have an idea to fix this, but I haven't done so yet.
(Edit: You CAN specify fields that are not indexed, and I've verified this works well).
2 (new). Google is pushing a new database backend called ndb that does automatic caching and batching, which will not be available with django-nonrel.
If you decide not to use django-nonrel, the main differences are that Django models do not run under App Engine. You'll have to rewrite your models to inherit from App Engine's db.Model. Your forms that use Django's ModelForm will need to inherit from google.appengine.ext.db.djangoforms instead. Once you're on App Engine, you'd have to port back Django if you ever take your app somewher else.
If you already have a Django application you might want to check this out. You won't work with App Engine's datastore but Google Cloud SQL might fit your needs.

What steps do I take to integrate an (outdated) but working django application into my project?

I would like to integrate an existing application someone has on github into my site. What steps do I need to take to integrate it?
Would most people just download this entire thing and throw it inside of the project root, add it to the INSTALLED_APPS and modify urls.py? I would imagine there are some extra steps I'd have to take to get it to work.
In addition, since it was written in Jan 09-esque, and I'm using the latest 1.2 release I would probably have to modify and add some form csrf checking?
There are no generic instructions for integrating existing application into your django project because every application is different.
Generally most of the popular apps provide README/INSTALL docs which guides you through installation and How to use app. An app without documentation & tests is risky to use unless you are ready to own it and take pain of going through source code and figuring it out.
Also I don't think the application you posted above can be integrated into your project without modifying the code. It's a project by itself and can be used in standalone mode. (Well that's what I think after looking at source code)

Should I use google-app-engine-django or app-engine-patch or neither or something else?

Do I need either to make Django easier to use on GAE? Anyone had good or bad experience of either or any equivalent? Is there much difference between these? Which is easier to use?
Regards
Geoff
I am assuming you want to run django on app engine (otherwise using appengine API directly is the best solution).
Altho' Google App engine supports django 1.0 out of the box, django admin, auth doesn't work on it, as they are dependent on the models.
Appengine patch patches django to make the admin work even on the Bigtable API.
Appengine patch also often makes sure to work on the latest release of django.
So, again, "You should use App engine patch"
Google App Engine Patch seems to have died sometime around August 2009.
http://code.google.com/p/app-engine-patch/issues/detail?id=253
I think it depends on what exactly you want to develop.
You should use app-engine-patch if you need the Django Admin interface, otherwise google-app-engine-django should be enough.
Use Django patch if you already have django application that you know that you want to use. Remember that GAE comes with its own API/applications.