Posts

Showing posts with the label django

Heroku Postgres Database Backup

Image
Hi I have Heroku ,And I face lot of problems in upgrading the models based on the changes . http://www.panhidhalyrics.com/ Based on lot of discussions  the migrations of Heroku ,  doing in local and apply them in the remote after pushing not gives me the expected outcome. Rather application ends up in  errors. 1. $ heroku run python manage.py makemigrations panhidhaapp 2. Push the changes to git   3.  $ heroku run python manage.py migrate The other thing we can do it  we change the Model and apply the change in the DB manually trough PgAdmin Frist you need to login and get the db Cardinals https://id.heroku.com/login Navigate to the following location Application >> Addons >> Heroku Postgres :: -- >> Overview Section Open PgAdmin and  give the detail as it is .The value in the database will be given to the maintenance db in pgAdmin.   After login you have to navigate to your own database which does ...

Heroku Django manage.py makemigrations - Error settings.DATABASES Please supply the ENGINE value

Image
Hi ,While I'm dying hard for the make the migration done with heroku ,,, the following command  always lead to the above error . $ python manage.py makemigrations  "raise ImproperlyConfigured("settings.DATABASES is improperly configured. " django.core.exceptions.ImproperlyConfigured: settings.DATABASES is improperly co nfigured. Please supply the ENGINE value. Check settings documentation for more details" However it Takes me lot of time to understand  I'm using wrong command in heroku environment .Thanks for the below post ,Save a lot of time http://stackoverflow.com/questions/28138706/heroku-database-migration-does-not-create-tables Correct Command : $ heroku run python manage.py makemigrations panhidhaapp

django TextFeild print as a text Area

When printing django  TextFeild  without <p> </p> tag encoding it will display  just as a sentance without <br/> , \n ,\r ( breaks , newlines) However text area can encoded with <p> </p>  and supported with  linebreaks   which result the paragrh with expected breaks and newlines <p>     {{ post.song |linebreaks }}  </p>

python.exe: Resolve "command not found"

Recently when I was working on hosting Django site in Windows 7 machine I came up through the following error (python command not found) $ c:\Python27\python.exe django-admin.py startproject myproject . sh.exe": c:Python27python.exe: command not found Frist I discovered it is because of not having back -slash  and I added (\\)  $ c:\\Python27\\python.exe django-admin.py startproject myproject . c:\Python27\python.exe: can't open file 'django-admin.py': [Errno 2] No such fil e or directory In this way you can invoke phthon.exe without adding it to environmental variables by giving absolute location. (c:\Python27\python.exe) However another error still persisting "can't open file 'django-admin.py': [Errno 2] No such fil e or directory". Since django is located in the site packages it also required to give the absolute parth. In my case it is "C:\\Python27\\Lib\\site-packages\\django\\bin\\django-admin.py" So that below ...