I have downloaded this project http://code.google.com/p/django-budget/
How can i install it. Do i need to execute some commands or just extract it to some folder.
DO i need to use syncdb.
I am newbie so don't know much
PS. It's been moved to https://github.com/toastdriven/django-budget for a while now.
There is information on the frontpage of the site:
Installation
Either copy/symlink the budget app
into your project or place it
somewhere on your PYTHONPATH.
Add the budget.categories,
budget.transactions and budget apps to
your INSTALLED_APPS.
Run ./manage.py syncdb.
Add (r'^budget/',
include('budgetproject.budget.urls')),
to your urls.py.
You need Python and Djano installed.
Related
I'm new using django-postman and django and I just downloaded a copy of the django-postman package to use with my app. I added 'postman' to the INSTALLED_APPS settings.py of my project and url(r'^messages/',include('postman.urls',namespace='postman',app_name='postman')), in urls.py. However, I'm not sure where to put the downloaded package and integrated with my project. I think I added the app to my Python path with pip install django-postman==3.6.2, but when I use url(r'^messages/',include('postman.urls',namespace='postman',app_name='postman')) my django program says that there's not an app called 'postman'. How do I include the django-postman app to my project? Also since the app_name='postman' in urls.py is not longer valid for python 3.6 should I just take it out of the statment?
I change my computer and I migrated my django project just by copying the directory created by django-admin create project from the old computer to the new one. I installed all required modules in the new computer (including django) under a new Python virtual environment, and everything worked perfectly, but the admin site of the project, that shows in plain html with no styling at all.
I don't know how to fix it
This happened to me when I transferred the project to the production server for the first time. I don't know if you are using runserver or is your new computer hosting the project with Apache or Nginx. If it is the latter try the following command on the project root directory.
python manage.py collectstatic
Beware that you also need to specify the STATIC_ROOT and STATICFILES_DIRS in the settings.py file in order for the above command to work.
Refer to the django docs in order to learn more about working with static files in Django.
I am trying to learn django and I have completed the official django 1.7 "polls" app and also the popular gswd. Now I am trying to understand the codebase of everyblock.com They provide the backend code for learning purposes. This is the README file on everyblock
==========
everyblock
==========
This package contains code/templates that are specific to EveryBlock.com. They
are released to fulfill the terms of the grant that funded EveryBlock's
development and are likely not of general use.
Overview
========
The package is split into these directories:
admin -- EveryBlock's internal admin application for managing its data
cities -- City-specific data-acquisition scripts (for 15 U.S. cities)
media -- CSS file for the admin
states -- State-specific data-acquisition scripts
staticmedia -- A Django template tag specific to EveryBlock.com media files
templates -- Templates for the admin
utils -- Various utilities used on EveryBlock.com
Quickstart
==========
0. Install PostgreSQL, PostGIS, Django, psycopg2.
1. Install the everyblock package by putting it on your Python path. Also
install the ebdata, ebpub and ebgeo packages.
2. Start a Django project.
3. Put the smorgasbord of eb-specific settings in your settings file. It's
probably easiest to just start with the file ebpub/settings.py and tweak
that (or import from it in your own settings file). The application won't
work until you set the following:
DATABASE_USER
DATABASE_NAME
DATABASE_HOST
DATABASE_PORT
SHORT_NAME
PASSWORD_CREATE_SALT
PASSWORD_RESET_SALT
METRO_LIST
EB_MEDIA_ROOT
EB_MEDIA_URL
See the documentation/comments in ebpub/settings.py for info on what the
various settings mean.
4. Run "django-admin.py syncdb" to create all of the database tables.
5. Run "django-admin.py runserver" and go to http://127.0.0.1:8000/ in your
Web browser to see the site in action.
I have downloaded ebdata and ebpub packages and unzipped. I can see the files. I have installed PostgreSQL, PostGIS, Django, psycopg2. How do I go ahead with the next steps. I don't get how the three Packages can be installed by putting them in python path, start a django project and get it running locally. Any help?
Depending on how you installed your dependencies, they may already be in your python path.
Run python from your terminal and see if you can import django. If you can it's already in your python path.
$ python
Python 2.7.9
>>> import django
>>>
If that works, you can create a new django project
django-admin startproject everyblock
then just copy all the files you unzipped into the project folder and modify the settings.py file to point to your database.
(NB: Everyblock was released in 2009. It won't run using the latest version of Django without making some changes. It's also not a trivial project to begin with, so you may want to start with a different project until you are a little more comfortable.)
I've installed Django-registration succesfully (form this tutorial).
So now I have a Django project "loginSystem", with in this map urls.py, settings.py, manage.py and _init_.py, so there is no app created but it works. The registration-folder is installed in my python-packages folder.
No I want to give to each users a unique profile, so I'll do this manual for django-profiles. The profiles folder is also installed in my python-packages folder.
But what do I have to create now to follow and start this django-profiles manual?
Because they start speaking about a "/profiles/edit"-folder...
So do I have to work in the dist-packages/profiles folder, or in my project-folder (without app)?
Thanks a lot, it asked me already a lot of time without result...
I don't see there they are talking about a /profiles/edit/ folder. The only thing you have to do is creating a /profiles/ folder in your TEMPLATE_DIR and put an edit_profile.html template there. Then you still need to hock up the url configuration to serve the edit view of the profiles app (they suggest a url somewhere like /profiles/edit/) and then you are good to go. Its basically the same as for django-registration except django-registration already create the url configuration for you.
I am trying to create my first site in Django and as I'm looking for example apps out there to draw inspiration from, I constantly stumble upon a term called "reusable apps".
I understand the concept of an app that is reusable easy enough, but the means of reusing an app in Django are quite lost for me. Few questions that are bugging me in the whole business are:
What is the preferred way to re-use an existing Django app? Where do I put it and how do I reference it?
From what I understand, the recommendation is to put it on your "PYTHONPATH", but that breaks as soon as I need to deploy my app to a remote location that I have limited access to (e.g. on a hosting service).
So, if I develop my site on my local computer and intend to deploy it on an ISP where I only have ftp access, how do I re-use 3rd party Django apps so that if I deploy my site, the site keeps working (e.g. the only thing I can count on is that the service provider has Python 2.5 and Django 1.x installed)?
How do I organize my Django project so that I could easily deploy it along with all of the reusable apps I want to use?
In general, the only thing required to use a reusable app is to make sure it's on sys.path, so that you can import it from Python code. In most cases (if the author follows best practice), the reusable app tarball or bundle will contain a top-level directory with docs, a README, a setup.py, and then a subdirectory containing the actual app (see django-voting for an example; the app itself is in the "voting" subdirectory). This subdirectory is what needs to be placed in your Python path. Possible methods for doing that include:
running pip install appname, if the app has been uploaded to PyPI (these days most are)
installing the app with setup.py install (this has the same result as pip install appname, but requires that you first download and unpack the code yourself; pip will do that for you)
manually symlinking the code directory to your Python site-packages directory
using software like virtualenv to create a "virtual Python environment" that has its own site-packages directory, and then running setup.py install or pip install appname with that virtualenv active, or placing or symlinking the app in the virtualenv's site-packages (highly recommended over all the "global installation" options, if you value your future sanity)
placing the application in some directory where you intend to place various apps, and then adding that directory to the PYTHONPATH environment variable
You'll know you've got it in the right place if you can fire up a Python interpreter and "import voting" (for example) without getting an ImportError.
On a server where you have FTP access only, your only option is really the last one, and they have to set it up for you. If they claim to support Django they must provide some place where you can upload packages and they will be available for importing in Python. Without knowing details of your webhost, it's impossible to say how they structure that for you.
An old question, but here's what I do:
If you're using a version control system (VCS), I suggest putting all of the reusable apps and libraries (including django) that your software needs in the VCS. If you don't want to put them directly under your project root, you can modify settings.py to add their location to sys.path.
After that deployment is as simple as cloning or checking out the VCS repository to wherever you want to use it.
This has two added benefits:
Version mismatches; your software always uses the version that you tested it with, and not the version that was available at the time of deployment.
If multiple people work on the project, nobody else has to deal with installing the dependencies.
When it's time to update a component's version, update it in your VCS and then propagate the update to your deployments via it.