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.
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 developing a project using django python server. I have created my project on django and put all my files including views.py in the project folder and I am using it without creating any app and its working fine.
Is this the right way of doing it (or) I need to create an app instead and put all my files in the project ?
This will work fine. Views can be wherever you want.
You can add the package that is your site (the one that has settings.py in it) to INSTALLED_APPS, and then a models.py in it, management commands, et cetera will also work fine.
Apps are handy when things become big and you want to split them into smaller parts.
I'm trying to setup a second development environment for my project. I've copied over the settings from the working setup but on the new one the URLs generated by the Django admin are prefixed with /admin/. This does not happen with the other setup at all.
More details:
I'm using django-grappelli for my admin panel.
The generated urls on the working setup are of the kind /static/grappelli while on the not-working one they are of the kind /admin/static/grappelli.
Disabling grappelli yields no fix either, the urls are then of the kind /admin/static/admin.
I'm using Django 1.5, it uses a git repository for the source files and a frozen pip requirements.txt. I can only conclude that version differences are highly unlikely.
Other static files work fine, only the admin related ones are hit with this.
My URL settings are the following:
STATIC_URL = '/static/'
MEDIA_URL = '/static/media/'
The *_ROOT ones are not set due to use of development server.
I'm out of ideas as to why this is happening on only one of the servers with the same setup.
edit:
Removing the /admin/ prefix allows you to properly access the files. The finder is fine, but the urls generated are just wrong.
The fix is very simple, the STATIC_URL setting should always contain the first /. It seems the Django admin prepends /admin/ if there is none.
I had a faulty settings file overwriting my default STATIC_URL, always check your settings first!
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.