python2.7 django 1.10.3. Can't use oauth2app - python

I have installed oauth2app using pip and I added it to setting.py, when I run migrate the tables for oauth2app are not created in MySQL.

The last update of oauth2app on git was in 2014. So as i understand it didn't support new versions of django. However I found django-oauth-toolkit, that connect oauth2app with new version of Django. Try it, maybe it's helps you.

Related

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.

Running old django app in new virtual environment

I have a django app i was running in python 2.7 and django 1.7.10.However am trying to transition it to django 1.8. I have created a new virtualenv,installed python2.7 and django 1.8 in it and moved the app there.However when i run the server it still reads django 1.7.10.What could be the problem ?
console
enter image description here
You do not need to move application for new virtual environment you just need to activate it probably you did not activate new one. Actually also you do not need a new virtual environment for upgrade. Just pip install -U django==1.8 it will upgrade your django and then make necessary edits.

Mongoengine.django not found

Python ver=3.4
Django ver=1.9.2
In my project I am trying to integrate mongodb with above django version I have installed the mongoengine in my virtual environment and have made the necessary in settings.py file.
I am able to start the server but when I try to run the project in the browser it notifies me
A server error occurred. Please contact the administrator.
and in the terminal shows up.
Please tell me the correct way to integrate the mongodb if I am doing something wrong.
Okay so your issue lies in the version of mongoengine you are using. I am using the version 0.8.7 and it has mongoengine.django but the latest version on Github (0.10.6) has this deprecated.
Django support has been split from the main MongoEngine repository.
The legacy Django extension may be found bundled with the 0.9 release
of MongoEngine.
source -> http://mongoengine-odm.readthedocs.org/django.html

Synchronizing development PostgreSQL database on local machine

I developed a Django website in Linux, learning Django and git along the way; pushed the source files to Bitbucket.
I'm now in Windows and wanted to see if I could figure out how to work on the project from Windows (just to practice with version control). I did the following:
installed python (3.4) installed virtualenv,virtualenvwrapper-win
installed PostgreSQL from the windows installer on their website
installed psycopg2 from a .whl file because pip was insisting I don't
have c++
installed git using the windows installer from their website
cloned bitbucket repository using git
create a virtualenv using virtualenvwrapper, installed dependencies
from requirements.txt (except for psycopg2 which I had to install
manually)
now I'm a bit confused about the database, do I need to create a new one? how do I synchronize with the local database I created already in linux? is the database part of the version control?
I know that sqlite has a .sqlite file, but postgresql seems to work a bit differently.
EDIT:
I recreated the database and the user in windows, but how do I make sure the information with the Database synchronizes with wherever i'm developing
Fixtures can be used to move data between databases.
From the docs
A fixture is a collection of data that Django knows how to import into
a database. The most straightforward way of creating a fixture if
you’ve already got some data is to use the manage.py dumpdata
command.
--
Loading data is easy: just call manage.py loaddata <fixturename>,
where is the name of the fixture file you’ve created.
Each time you run loaddata, the data will be read from the fixture and
re-loaded into the database. Note this means that if you change one of
the rows created by a fixture and then run loaddata again, you’ll wipe
out any changes you’ve made.

How to create a sample django project?

This doesn't work for me.
$ python django-admin.py startproject myproject
I am running a ubuntu virtual m/c on my windows system.
By default ubuntu 12.04 comes with python 2.7.3 so I am using that only
I downloaded or installed (whatever it does since I am new to django) by issuing the following command-
git clone https://github.com/django/django.git
django directory is successfully created.
I want to create a sample django application. So for this I am issuing the following command-
$ python django-admin.py startproject tango_with_django_project
Obviously, it will throw error since the default ubuntu python doesn't know that django has been installed.
My Question is how to integrate python with this Django and create a sample django application?
The comments above pointing you to the documentation are of course correct, but there are also other resources that can help you start your site the 'right' way. In particular, cookiecutter and its related Django template will get you set up with some really good defaults and valuable third-party apps straight away. If you have cash to spend I'd also heartily recommend the book Two Scoops of Django, by the people who wrote the two applications to which I've linked.
Jeff Knupp has also written a thoroughly useful blog post on starting a Django project the right way, which covers useful topics such as the importance of:
source control;
automated testing (see also this excellent book);
isolating your development environment to smooth deployment; and
managing your database with migrations (included in Django since version 1.7).

Categories

Resources