How to manage two django versions in single ubuntu machine - python

How to install two different versions of django. I went through many answer but none of them satisfying my need.
1.I want two install 1.5 or 1.6 without replacing 1.4
2.My application is currently live which was developed using 1.4.
3.But I want to use some python-django libraries to get new features in my application.
4.That library is compatible with django 1.5+.
5.I dont want to use virtual environment.
6.And I want to install in same directory/dist-packeges.
Is there any way two do so,,,,,,?

You can't have two versions in the same project. That's impossible: they would simply conflict - for example, what would happen when you did from django import template? How would the system know which version to use?
The only thing you could possibly do is have two separate projects, with their own versions of Django (and yes, using virtualenvs), each serving a part of the site.
Otherwise you will simply need to upgrade your existing project to Django 1.5+. It's not hard, Django is very good with backwards compatibility.

You have two options.
Django code is open to you So I will suggest to customize your current Django code with any library you want.
Or Create new app as utils and override current django feature into this new app and use this app as a django plugin.

Related

Install Django apps through the Django admin-site like plugins in Wordpress

I want to implement a module-manager in Django where third-party modules can be installed through the django admin interface (without changing the code-base of the main project). Or it could also be a service that runs on top of django.
These modules should have the same capabilities as a django app. For example, defining models and views, making migrations, and interacting with other apps. Similar to how it works with the plugin-manager of Wordpress.
Is there a good way to do this? (and are there reasons why I should not?)
What is a Django app? According to Django Packages
Small components used to build projects. An app is anything that is installed by placing in settings.INSTALLED_APPS.
Generally speaking, here are the steps to have an app working in Django
Install the app
pip install app
Register the app in one's settings.py
INSTALLED_APPS = [
...
'app',
...
]
In some cases they'll require to sync the database. Such is the case with social-auth-app-django. Here you'd have to do as well
python manage.py migrate
In some other cases they require specific versions of Python, Django, ect, so that'd have to be taken in consideration too. Such is the case with Django REST framework which requires
Python 3.6+
Django 4.1, 4.0, 3.2, 3.1, 3.0
It's possible as well that apps are dependent on certain Python libraries. Then, one would have to install them too.
For a basic version of that, one wants to create a place to have a button to install an app as well as a model to store the app. The model will keeps track of specific variations with BooleanField.
More precisely, since we now know some apps require database sync, the app model will have requires_db_sync = BooleanField(default=False). Then, if that's true, when installing that app one will want to run at least steps 1, 2 and 3.
One will eventually want to do a thorough analysis of the existing apps and understand the different possible variations (dependencies, requiring DB sync, etc).
I work with WordPress too and this was a thought that came to my mind a few years ago. I didn't pursue it because for most apps I still had to go to the code and do various configurations.
To deal with that, WordPress plugins, like WPForms, come with pages where one does that configuration.
Since such Django app configuration pages for configuration don't yet exist, they'd have to be created as well.
Also, would be great to have a trusted agency with standards to validate an app as good to be in that system.

In Django which version is now stable in 2019?

I was using django 1.1 and python2.7 in my project.
Now I will setup a new Django project from scratch. So i want to know if the above configuration is correct for my new project or I should use python3 and latest django version. If so then which Django,Python version will be good for new project? And I should get good support from django community.
Thanks
Currently, the last stable version of Django is 2.1.7. This version works with Python 3.7. You'll find a lot of support for this version of Django... there are a lot of develops about this version, such as Django Rest Framework, JWT, among others.
I suggest you for a project from scratch, work with Django 2.1.7 and Python 3.7, probably, you'll get quickly your goals. If you need to update your knowledge, you can do a course on a web platform as Udemy.
Soon Django 2.2 will be released... but I suppose we have to wait some days to get all benefits of this new release.

Latest django-mongodb-engine

I'm following the guide to setup django-mongodb. But this line pip install git+https://github.com/django-nonrel/django#nonrel-1.5 always reverts my django to 1.5. Is there anyway that I can use lastest django?
That is because django-nonrelis a fork from the original Django project.
You can consider that as a different project.
django-nonrel was developed side by side with the original Django project until version 1.6, the last commit for nonrel is 2 years old.
To sum it up, if you want to use django-nonrel it is not recommended and you are limited to latest Django version it supports - 1.6.
The django-nonrel project is dead - If you want to use a NoSQL I will recommend not using Django.
There is't any official support for that, and I did not find any on-going projects (third-party) that exist anymore.
pip install git+https://github.com/django-nonrel/django#nonrel-1.6
The latest django-mongodb-engine is no longer operational. Using mongoengine alone will work only if your project does not use ANY contrib modules like, session, auth, user.
I recently came across another package called djongo. It is working fine on the latest version of Django.
Disclaimer: I have contributed to this package, but i am not trying to promote it anyway. I think it solves most of the Django MongoDB issues that have been around for ages and is extremely easy to use.

Nitrous.IO and Django non-rel

Is it possible to use Django non-rel with a Nitrous.IO box without using virtualenv?
Using virtualenv, I can setup the version and apps needed to run Django non-rel. But Is there a better way?
I have a "bran" box with Django stack, and looking in Autoparts, there doesn't seem to be any Django packages listed. Let alone non-rel.
Note: Asked during Nitrous.IO Beta

Getting started with Django-Instant Django

I've been trying to get Django running and when going through the intro to projects it seems that I keep having trouble when I get to the 'sync database' section. When using InstantDjango this doesn't seem to be as much of a problem. My question is, can one just do Django development with the InstantDjango program or do you really need to run it the normal way?
InstantDjango uses sqlite by default. What database did you set your normal django to use? and you did you create that database before you ran the syncdb?
InstantDjango uses different packaging for all the django required libraries (portable versions) which might be less stable but they should work for your development needs.

Categories

Resources